WebsiteBaker Support (2.8.x) > Templates, Menus & Design

highlight current page using showmenu2

(1/3) > >>

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!

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:

--- Code: ---.menu-current {
background:#ff0000;
text-decoration:none;
}
--- End code ---
to highlight the current page in the menu, whatever its name is.

HTH,

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!

erpe0812:
Yes in the same way.
It should be formatted as


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

rgds

erpe

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:

--- Code: ---<?php echo MENU_TITLE; ?>
--- End code ---

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

How can I do?

Thanks!

Navigation

[0] Message Index

[#] Next page

Go to full version