Hi,
I am new to using cmsms and php. I have found the menu manager module very flexible.
However there is somthing i am trying to do which i am finding difficult. I am using the 'simple_navigation.tpl' template. When it is building the '' elements i would like to add a 'id' attribute and populate it with the name of the corresponding node for that page.
For e.g. For the following html fragment for the menu:
4: Extensions Test
I would like to set the 'id' attribute to "extensions-test". If have tried a few things, however have had no luck.
I would be very appreciative if someone could assits
> michael
Adding node name to 'id' attribute of '<li>' tag in simple vertical menu
Re: Adding node name to 'id' attribute of '<li>' tag in simple vertical menu
You need to copy the menu template then add menutext}"[/color] to get the name of the page...
Go to Extensions » Modules and, in new version the name of the module does the same thing, on the right you see the word Help click that to get the list of calls to make in a menu template....
The parameters for the $node object used in the template are as follows:
* $node->id -- Content ID
* $node->url -- URL of the Content
* $node->accesskey -- Access Key, if defined
* $node->tabindex -- Tab Index, if defined
* $node->titleattribute -- Title Attribute (title), if defined
* $node->hierarchy -- Hierarchy position, (e.g. 1.3.3)
* $node->depth -- Depth (level) of this node in the current menu
* $node->prevdepth -- Depth (level) of the node that was right before this one
* $node->haschildren -- Returns true if this node has child nodes to be displayed
* $node->menutext -- Menu Text
* $node->target -- Target for the link. Will be empty if content doesn't set it.
* $node->index -- Count of this node in the whole menu
* $node->parent -- True if this node is a parent of the currently selected page
Go to Extensions » Modules and, in new version the name of the module does the same thing, on the right you see the word Help click that to get the list of calls to make in a menu template....
The parameters for the $node object used in the template are as follows:
* $node->id -- Content ID
* $node->url -- URL of the Content
* $node->accesskey -- Access Key, if defined
* $node->tabindex -- Tab Index, if defined
* $node->titleattribute -- Title Attribute (title), if defined
* $node->hierarchy -- Hierarchy position, (e.g. 1.3.3)
* $node->depth -- Depth (level) of this node in the current menu
* $node->prevdepth -- Depth (level) of the node that was right before this one
* $node->haschildren -- Returns true if this node has child nodes to be displayed
* $node->menutext -- Menu Text
* $node->target -- Target for the link. Will be empty if content doesn't set it.
* $node->index -- Count of this node in the whole menu
* $node->parent -- True if this node is a parent of the currently selected page
Re: Adding node name to 'id' attribute of '<li>' tag in simple vertical menu
Thanks for that mark.
I tried menutext}" previously, however it had the 'displayname' of the page. What I'm after is the name of the page as it appears in the url path.
For e.g. for menu item:
4: Extensions Test
I would like to fetch 'extensions-test' rather than 'Extensions Test'. I'd prefer this name as it is safer for tag id's, as it has no spaces in.
Cheers
> michael
I tried menutext}" previously, however it had the 'displayname' of the page. What I'm after is the name of the page as it appears in the url path.
For e.g. for menu item:
4: Extensions Test
I would like to fetch 'extensions-test' rather than 'Extensions Test'. I'd prefer this name as it is safer for tag id's, as it has no spaces in.
Cheers
> michael
Re: Adding node name to 'id' attribute of '<li>' tag in simple vertical menu
Thanks for your prompt response Mark. That did the trick .... thanks heaps!
Cheers
> michael
Cheers
> michael