Page 1 of 1

Menus: Add node->Alias to the assigned template vars

Posted: Sun Apr 23, 2006 8:15 pm
by Chris..S
Hi,

I tried to work out how to add this via the forge, but couldn't see any where to add anything :?

In order to individually style some menu items it would be handy to have a string available for use as an id in the menu template.  The node->Alias value seems to fit the bill.

Its a pretty simple patch too

Code: Select all

// file: modules/MenuManager/MenuManager.module.php
// fn: FillNode
// line:  ~ 187, add
$onenode->alias = $content->Alias();
It'd be handy as well to be able to add custom fields to the news module, but I'll save that one for later.

Re: Menus: Add node->Alias to the assigned template vars

Posted: Fri Apr 28, 2006 10:20 pm
by Dr.CSS
i've used,,

id}">id}" title="{$node->menutext}"{/if} href="{$node->url}">{$node->menutext}

to pic out individual menu items, such as for Imap menus.

  mark

Re: Menus: Add node->Alias to the assigned template vars

Posted: Mon May 08, 2006 5:53 pm
by Chris..S
Yes, that would work.  However, its not immediately apparent what the id for a given page is. 

Also, alias is visible on the options tab of the page content and its user configurable, allowing meaningful names.

Re: Menus: Add node->Alias to the assigned template vars

Posted: Mon May 08, 2006 6:16 pm
by Dr.CSS
yep
i had to render the page then look at source to find the id number,
you just have to be careful, when i first tried the Imap thing it didn't like 2 word {$node->menutext} so i switched to id, and i've used it to add diff. color and :hover color to each menu item here www.blueoakom.com/

    mark

Re: Menus: Add node->Alias to the assigned template vars

Posted: Mon May 08, 2006 6:26 pm
by Chris..S
maksbud wrote: it didn't like 2 word {$node->menutext}
Yep, that why I use alias.  Its sanitised, I guess for to be ok for urls , so spaces are replaced with "_" etc.

Re: Menus: Add node->Alias to the assigned template vars

Posted: Mon May 08, 2006 7:49 pm
by Ted
I've added alias to the menu manager module.  It'll be in the next release.  Thanks!

Re: Menus: Add node->Alias to the assigned template vars

Posted: Mon May 08, 2006 11:55 pm
by Greg
Thank you !

Re: Menus: Add node->Alias to the assigned template vars

Posted: Tue May 09, 2006 9:55 am
by Chris..S
Yes, thank you!