View Full Version : Force highlight a CSS Menu Writer menu item
cpfusion
08-24-2009, 12:59 AM
I was wondering if it is possible to force highlight a menu item?
I have a menu with 7 main items, of which 2 have sub menus. All are working correctly, but I have a page which is not accessible through a sub menu, so it doesn't highlight the top menu item when the page is loaded.
e.g. the menu title is "Top Level", and the main page is "top_level.php". I then have a page which is "top_level2.php" which is categorised under "Top Level" but does not require a sub menu. I would like the "Top Level" menu to be highlighted when "top_level2.php" is selected. Is this possible?
Jason Byrnes
08-24-2009, 02:52 PM
I'm not 100% sure I follow the question, can you p[lease post a link to demonstrate so I can get a better understanding.
CraigR
08-24-2009, 03:13 PM
I think I know what you mean.
i have a sample site http://gallery.stonepits.com
if you select the gallery page, the gallery is highlighted on the navigation bar.
if you select a submenu within gallery, the gallery link remains highlighted.
is this what you mean ?
there is a good article on how to do this here...
http://www.alistapart.com/articles/keepingcurrent/
cpfusion
09-05-2009, 08:53 AM
Craig,
Thanks for the pointer, but it doesn't really answer my question.
The page I have is not actually part of the menu system at all, but I would still like to force one of the menu items to highlight to indicate that this hidden page is part of that particular section without being selectable from the menu.
Craig
CraigR
09-05-2009, 09:08 AM
Hi,
it doesn't make any difference that the page isn't on the menu.
I have a couple of pages which are not navigable from the menu, where they have the current page indicator to be the same as a menu page, hence the menu is highlighted accordingly.
If you read through the article, it should help you achieve this.
cpfusion
09-09-2009, 07:19 AM
Hi Craig,
I appreciate your response and after reading the article again, I realised that the main issue was that I wasn't reading the PHP Include section. As I am using a PHP Include to add the menu to each page, this method was what I was looking for.
Many thanks for pointing this one out.
Best,
Craig
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.