Understand what I can do with a menu module

satya - Wednesday, August 03, 2011 11:00:46 PM

Key Structure of a menu item


path to the menu
a page callback function
arguments to the function
menu item type
access rights needed

satya - Wednesday, August 03, 2011 11:01:57 PM

multiple menu items can be declared in a single menu hook

multiple menu items can be declared in a single menu hook

satya - Wednesday, August 03, 2011 11:02:50 PM

menu item hierarchy is implied

when you declare a menu item through a hook you dont indicate who your parent menu item is. this is implied by looking at the menu path.

satya - Wednesday, August 03, 2011 11:03:17 PM

drupal menu hook menu_name

drupal menu hook menu_name

Search for: drupal menu hook menu_name

satya - Wednesday, August 03, 2011 11:04:34 PM

when you declare a menu item it shows in the navigation menu by default

what is the menu_name points to then?

satya - Wednesday, August 03, 2011 11:06:24 PM

understand drupal menus

understand drupal menus

Search for: understand drupal menus

satya - Wednesday, August 03, 2011 11:14:20 PM

menu administration appears to be a bit disconnected from hook menu

Or am i just confused with the initial flurry!!

when I use the admin, i create any arbitrary menu with just a name. then i can add menu links underneath. these links can point to any path. these links can be children of each other.

So the parent child relationship is not really done by the path, it appears. or is it?

How can I link these two worlds? the programmatic menus and the admin menus? when I add a programmatic menu where does it end up? Under which admin menu will it show?

will it show in the navigation menu first? and then one can move it to the other menus??

satya - Wednesday, August 03, 2011 11:24:19 PM

so what is the sturcture of an admin menu

when you define menus through the admin screens each menu is a hierarchical set of links.

Such a named menu can then be placed in a block. However the menu needs to be themed to display it either as vertical or horizontal etc.

It is especially not clear how to create a menu that flows through using dhtml.

satya - Wednesday, August 03, 2011 11:26:37 PM

How can I create sub menus in drupal

How can I create sub menus in drupal

Search for: How can I create sub menus in drupal

satya - Wednesday, August 03, 2011 11:28:41 PM

How are arguments passed to a menu function

this needs to be verified.

The additional path segments is each passed as a variable set of arguments but the function has to declare them

If you specify page callback arguments then they will be passed first to the menu function followed by the path variables.

The menu function is ultimately responsible for returning the html that will be used to paint the content portion of a page.

satya - Wednesday, August 03, 2011 11:33:24 PM

it appears that menu paths and menu link hierarchy are orthogonal

This flows from the fact that links with arbitrary paths can be made children of each other irrespective of their path hierarchy

satya - Wednesday, August 03, 2011 11:34:59 PM

how does this gel with menu categories?

In the drupal adminsitration page how does one create menu categories and menu items with in those. this seem to be an added on concept on top of menus.

satya - Wednesday, August 03, 2011 11:38:27 PM

An interesting claim: drupal in 7 hours

An interesting claim: drupal in 7 hours

investigate further

satya - Wednesday, August 03, 2011 11:49:22 PM

This is a pretty good discussion on menu_name

This is a pretty good discussion on menu_name

satya - Wednesday, August 03, 2011 11:51:04 PM

Key findings of that discussion

you should have to have the menu created

you should prefix your menu title with menu- to refer to it via menu name.

Leads me to wonder if there is a better way to realize the machine name of the menu. One suggestion was to see the html source code that was generated.

The discussion also hints at overloading the install to create the MENU programmatically.

satya - Friday, August 05, 2011 9:43:10 AM

menu hierarchy conflict

Say I create a set of menus programmatically. Say the paths are hierarchical. By default these will show up in the navigation menu one under the other. This relationship is established by the paths. what happens when I go to the admin and rearrange their hierarchy? which hierarchy takes precedence?

satya - Friday, August 05, 2011 9:43:22 AM

I suppose I can test this

I suppose I can test this

satya - Friday, August 05, 2011 9:45:50 AM

you can do this in a menu path


/seg1/%/seg2/seg3
...
...
page callback argument => array(1)
...
function pagecallback($arg1){}

The $arg1 will contain the indicated path segment.

satya - Friday, August 05, 2011 9:47:34 AM

you can also do this


/seg1/%somefunc_name/seg2/seg3
...
...
page callback argument => array(1)
...
function somefunc_name_load($var1)
...
function pagecallback($arg1){}

The path segment is passed to a function and then the result is passed as arg1

satya - Friday, August 05, 2011 9:49:21 AM

It should be possible...

that given a menu or a menu path one should be able to create a page as one wishes. This appears to be the case where admin menu categories are constructed.

satya - Friday, August 05, 2011 9:50:14 AM

dhtml menus and drupal

dhtml menus and drupal

Search for: dhtml menus and drupal

satya - Friday, August 05, 2011 9:53:51 AM

dhtml menus project at drupal

dhtml menus project at drupal

satya - Friday, August 05, 2011 9:55:48 AM

This seems pretty nice the jquery menu

This seems pretty nice the jquery menu

satya - Friday, August 05, 2011 9:57:20 AM

Given a data structure is there a JS that can make a menu out of

By extension can I get the menu worth of data (essential the hierarchical links) as a render array or such structure that I can use my own template to render?