[Solved] Dynamic li item classes

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
Thierry-eamon

[Solved] Dynamic li item classes

Post by Thierry-eamon »

CMSMS 1.4.1
MenuManager 1.5.1
Menu based on minimal_menu.tpl


I was wondering if it is possible to get a menu who automaticly assings classes to al list items.. i.e.








or only to the first end last list item.. i.e.









I hope someone can help me
Last edited by Thierry-eamon on Wed Aug 20, 2008 6:48 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Dynamic li item classes

Post by Dr.CSS »

There is a post about using smarty logic to get the first and last items to carry a special class...

Search, and I'll also post back if I find it...
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Dynamic li item classes

Post by christiaans »

That would be very easy, and solved before, as mark stated.

Just to freshen up my own memory, you could do this as follows:
this creates a class for every page, using the page's alias. You can also 'just' use this for the parent items, for instance:
{if $node->parent == true}

{/if}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Dynamic li item classes

Post by Dr.CSS »

Actually {$page_alias} won't work in menu manager, it does in the template, use {$node->alias} and yes this will give all a class...
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Dynamic li item classes

Post by christiaans »

Oops, my bad. :(.
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Dynamic li item classes

Post by christiaans »

Topic closed & marked solved.
Locked

Return to “Layout and Design (CSS & HTML)”