live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
The great divide in the menu
« 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?
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: The great divide in the menu
« Reply #1, 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.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial