Modifyng Navigation template

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
Trangsene
Forum Members
Forum Members
Posts: 19
Joined: Thu Aug 28, 2008 9:43 am

Modifyng Navigation template

Post by Trangsene »

Hello,
I try to modify the template cssmenu.tpl.
I've added an accordeon menu with JQuery and i need to apply a class on an 'ul' submenu when you are in a page that belongs to this submenu. In other words I need to know if the submenu should be active or not.

Here is the code :

Code: Select all

<ul id="nav">
{foreach from=$nodelist item=node}

{if $node->depth > $node->prevdepth}

{repeat string="<ul class=\"subMenu\">" times=$node->depth-$node->prevdepth}

{elseif $node->depth < $node->prevdepth}
I've tried to add something like :

Code: Select all

{if $node->current == true...
But it's not working  :(

Is there a way to add a class on a submenu 'ul' if an 'li' of this 'ul' has the class="menuactive" ??????

If somebody has a solution, It would be a great help !

Thanks in advance.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Modifyng Navigation template

Post by Dr.CSS »

Do you have a sample of what it should spitting out for the menu?...
User avatar
Trangsene
Forum Members
Forum Members
Posts: 19
Joined: Thu Aug 28, 2008 9:43 am

Re: Modifyng Navigation template

Post by Trangsene »

Yes, you may see the accordeon menu here : http://www.metafight.eu/

When you choose a page that belongs to a submenu, for example this one : http://www.metafight.eu/metafight_structure.php, you can see that the submenu is visible by default now. To do that I have to apply a class to the ul submenu.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Modifyng Navigation template

Post by Dr.CSS »

OK here's how I do it, I start at the top of the menu template and start adding numbers before and after all the ul li calls to see where they show up in the menu when the page is rendered, even between the part the says repeat blabla every where you think it might help,

I used this method to get the | between these second level ul in the menu on the lower right in this site under ENITI, you have to hover the words next to the images to see | between the menu items...

http://www.mastoremata.reth.gr/cms/
User avatar
Trangsene
Forum Members
Forum Members
Posts: 19
Joined: Thu Aug 28, 2008 9:43 am

Re: Modifyng Navigation template

Post by Trangsene »

OK, thanks for your answer, but I still can't see how to apply dynamically a class on a submenu ul only when you are on a page that belongs to taht submenu  :-\
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Modifyng Navigation template

Post by Dr.CSS »

Did you import one of the menu templates from the file templates and start putting numbers in it to see where you need to add the classes for this?...

I could just build it for you but how much would you learn and I have paying work to do...
User avatar
Trangsene
Forum Members
Forum Members
Posts: 19
Joined: Thu Aug 28, 2008 9:43 am

Re: Modifyng Navigation template

Post by Trangsene »

Sorry but I have the impression we are not talking about the same thing.
It's on an ul I have to apply a class not on an li element
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Modifyng Navigation template

Post by Dr.CSS »

Right and if you add the numbers, 1, 2, 3, 4, 5,etc. in a menu template you will know where to put the class call in the menu template, like it may be you need to put it in the...

{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}

If you use the numbers like I said it will show you which ul you need to add the class to...

You may be looking for something like this...

http://multiintech.com/cmsmsdemo/
User avatar
Trangsene
Forum Members
Forum Members
Posts: 19
Joined: Thu Aug 28, 2008 9:43 am

Re: Modifyng Navigation template

Post by Trangsene »

Sorry I was away for a few days. I'm appreciating you try to help me.

Your link http://multiintech.com/cmsmsdemo/index.php?page=templates-and-stylesheets  is quite what I try to reach.
But when you click on an item of the first "Default..." submenu, : "Top Simple..." for example, this first submenu "Default..." does not stay opened when you arrived on the Top Simple page  :-[
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Modifyng Navigation template

Post by Dr.CSS »

I don't have that set to remain open, and I believe there is a setting in the JS to make this happen using a cookie...
Post Reply

Return to “Modules/Add-Ons”