Welcome to Geeklog, Anonymous Saturday, December 02 2023 @ 09:38 am EST

Geeklog Forums

Putting menu_elements in a block?

Status: offline


Forum User
Registered: 03/26/03
Posts: 5
So, I'm working on a block that will combine the "User Functions" with the "menu_elements" (and, of course, plg_menu_elements), creating a single place on the page for all of these, called "Actions". I didn't have much trouble finding the code in lib-common.php to copy and paste into my new function in lib-custom.php for the User Functions. I am having a hard time reproducing the "menu_elements" part. Any suggestions?

Status: offline


Site Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
So what exactly is your problem? What we have here is a nested template, i.e. a template (header.thtml) includes another template (menuitem.thtml). So the line $header->parse( 'menu_elements', 'menuitem', true ); parses the 'menuitem' template and puts the result into the {menu_elements} variable in the header template. This is done repeatedly (for each menu item), thus producing the menu bar. Hope that helps. bye, Dirk

Status: offline


Forum User
Full Member
Registered: 01/21/02
Posts: 269
How is this any different then the current menu plugin?---Danny @ squatty.com
In a world without walls and fences, who needs Windows and Gates?



Thanks for pointing me in the right direction, guys. I checked out the menu plugin, and it didn't do exactly what I had in mind. I meditated on your comment, Dirk..... And, finally, it came to me.

I mentioned that I had made a new phpblock in lib-custom by ripping out the code from lib-common. Well, since that's my own custom function, I found it easy to change the menu items by adding, removing and modifying the four line stanzas. So, for example my "Get Published" link appears thanks to this code:

$adminmenu->set_var( 'option_url', $_CONF['site_url'] . '/submit.php?type=story' ); $adminmenu->set_var( 'option_label', $LANG01[71] ); $adminmenu->set_var( 'option_count', '' ); $retval .= $adminmenu->parse( 'item', 'option' );

Now I get a bit better of an idea how the templates work, since they're set up a the beginning of the function to draw the "User Functions" block.


All times are EST. The time is now 09:38 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content