highlight current page using showmenu2

ivanisevic82

Hi find the solution!  :-D

<?php show_menu2(0, SM2_ROOT+0, SM2_START+0); ?>

without the long code posted ago...

Thank you!

ivanisevic82

I tried to put it in my css:


#menu.menu-parent{
color:#f89f05;
text-shadow: 1px 1px 2px #000;
}


but it doesn't work...

Maybe I've done something wrong?

Thank you again!


snark

#menu.menu-parent { }

have you tried to read the guides to showmenu2, it all is rather easy to use...

ivanisevic82

Thank you very much snark!

It's almost perfect, miss only a thing: I'd like that when I'm in a sub-page (child) the relative mother page stay "on".

So, using my site like example, when I'm in GLASS > PROVA1 I'd like to have the text hilighted not only for PROVA1 but for the mother "GLASS" too.

Is it possibile?

Thanks very much for your support!

snark

<?php show_menu2(1,SM2_ROOT,SM2_START,'','<li><a href="[url]" class="[class]">[menu_title]</a>','</li>','<ul>','</ul>','',''); ?>


ivanisevic82

I read documentation but I was not able to find solutions!

I'll wait for your help later or someone else before! :)

Thanks!

erpe0812

Your sm2 calls are wrong

I have no time yet, maybe I can write it later on..........

Hope it helps for the first, read the documentation of sm2 and complete your calls.

rgds

erpe

ivanisevic82

#7
Ok boys, this problem is solved too! :D

Now really the last one :D ...

Here the link at the template I'm building:
http://www.ivanisevic82.com/pages/glass.php

As you can see in the top horizontal menu there are the parent; in the right vertical menu there are the children.

*** IMPORTANT *** You can use only the page "GLASS"; "PAGINA MADRE" like "Parent" and "PROVA1", "PROVA2" and "PROVA20" like children. Do not use other page because they are for a different job.

Let's go to my problem...

If you stay in the page "GLASS" all is ok: you can see only the parent page on the top horizontal menu and the children of "GLASS" ("PROVA1" and "PROVA2")  in the vertical menu.

To have this I used showmenu2 in this way:

For the Horizontal menu
<?php show_menu2(0SM2_ROOT+0SM2_CURR+0); ?>

For the Vertical menu
<?php show_menu2(0SM2_ROOT+1SM2_CURR+1); ?>

So, now try to go in a children page "PROVA1".
The vertical menu it's ok...but the horizontal top menu NO!
It add after the parent page, the children page (you can see only "PROVA1" becouse there is not so much space, but after there is "PROVA2").
You can make another try going to "PAGINA MADRE" > "PROVA20".

Why it happens??

To have the right situation as when I'm in a parent page, as when I'm in a children page, I have necessary to create two different template?

Thank you very very much and, as usually, sorry for my english!


ivanisevic82

Thank you my friend, now it's ok!  :-)

I only need the last help: I use this string to view the Current Page name:
<?php echo MENU_TITLE?>

I'd like to have something similar that allow me to view the Currente PARENT (or mother) page.

How can I do?

Thanks!

erpe0812

Yes in the same way.
It should be formatted as

Quote.menu-parent {
background:#ff0000;
text-decoration:none;
}
Read your html output and you will find all classes but notice, that classes change by clicking.

rgds

erpe


ivanisevic82

Sorry, I wrote bad my question.

I don't want to highlight only the current page, but the "mother" page of corrent page too!

For example: if I have a "mother" horizontal menu and a vertical "son" menu, i want that is highlighted the son page and the relative mother page...

Is it possible?

Thanks!

PJW

Hi,

I don't have a lot of experience with show_menu2, but I had a look at the code the other day.

IIRC the current page list element is given the class menu-current, so all you need to is add a css entry like:
.menu-current {
background:#ff0000;
text-decoration:none;
}

to highlight the current page in the menu, whatever its name is.

HTH,

ivanisevic82

Hi!
To highlight the current page there are a lot of solution html+css or js...but for all soluzione is necessary to know the name of alla the page of the site (to apply some selector, for example...).

So, if I create a menu with showmenu2, I don't know what and how many page I will create: everytime I add a page, it will be insert in the site by showmenu2.

Is there a solution to highlight the "current page", without know before, all the pages you will insert in the site?

Sorry for my english, I hope you understand the question.

Thank you!