Page 1 of 1

Modifyng Navigation template

Posted: Thu Aug 28, 2008 9:59 am
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.

Re: Modifyng Navigation template

Posted: Thu Aug 28, 2008 11:43 pm
by Dr.CSS
Do you have a sample of what it should spitting out for the menu?...

Re: Modifyng Navigation template

Posted: Fri Aug 29, 2008 6:26 am
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.

Re: Modifyng Navigation template

Posted: Fri Aug 29, 2008 7:37 am
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/

Re: Modifyng Navigation template

Posted: Fri Aug 29, 2008 8:47 am
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  :-\

Re: Modifyng Navigation template

Posted: Fri Aug 29, 2008 7:37 pm
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...

Re: Modifyng Navigation template

Posted: Mon Sep 01, 2008 1:32 pm
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

Re: Modifyng Navigation template

Posted: Wed Sep 03, 2008 3:26 am
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/

Re: Modifyng Navigation template

Posted: Thu Sep 18, 2008 4:11 pm
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  :-[

Re: Modifyng Navigation template

Posted: Sat Sep 20, 2008 6:16 pm
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...