By thrice on
Can anyone point me at a simple example of a module that creates a menu inside a block? Just a heading with a couple of menu items underneath it, written in such a way that it follows the theme (I'm using phptemplate).
I've read the documentation but it won't quite gel. I tried looking at the menu.module code and got more confused than ever. A simple example I can build on would help a lot.
Comments
menu tree
Well if you mean you want a menu form a certain menu-item you could create a new block 'admin/block/add' and insert a piece of code like:
where the number of the menu you want is found in admin/menu/item/edit
luck,
Folkert
Why not just use the menu module to create the menu?
You can use the menu module to create new menus the enable the block(s) as needed.
depence on the structure i guess
If your menu is like 'home'->'headItem'->subItem you could simply make a menu, for let's say 'headItem', like i wrote in the last reply.
For a site wide menu you are right. just enable the block.
I need something more complex
I need to write a module that picks up items from a database and shows different menu items to different users based on certain criteria found in my business logic.
I'm asking for a simple example of how to build a menu, not because I need to do something simple, but because I need to understand how to do it!
2 examples…
Can’t get any simpler than the way menu module builds a menu block: http://api.drupal.org/api/function/menu_block/6
Here's a more complex example (no Drupal 6 port yet): http://drupal.org/project/menu_block
Wow, are you really using Drupal 4.6?Blargh. Not sure how I found such an old post. :-p- John (JohnAlbin)
- John (JohnAlbin)