Wedge

Public area => The Pub => Features => Topic started by: live627 on October 6th, 2011, 03:08 AM

Title: The great divide in the menu
Post by: live627 on October 6th, 2011, 03:08 AM
Seriously, it's just a variable with two names. What?

Ok, so each menu has its own internal identifier. But the ID is called differently in the source and in the template. The former has max_menu_id, whilst the latter has cur_menu_id.

Any reason for this?
Title: Re: The great divide in the menu
Post by: Arantor on October 6th, 2011, 03:12 AM
I don't know for sure, so from what I can remember off the top of my head...

Theoretically, you should be able to have more than one instance of the menu per page, through the generic template. No-one has ever done it as far as I know, and in fact to the very best of my knowledge the only times there are multiple "menu" instances on a page, it's not done through the generic template.[1]

I don't know why you would do it either, because it'd be a fucking mess if you did, but theoretically you can do it - in which case, max_menu_id would always be the 'last' one created, while cur_menu_id would be the one you're currently rendering.
 1. e.g. http://www.simpledesk.net/development/api/ has the top menu, the normal main nav menu and the actual contextual nav menu. I know that's the case, because neither SleePy's code (the top menu) nor mine (the page menu) used GenericMenu to do it.