Jump to content


Photo
- - - - -

How to select sidebar widget menu item while on a subpage?


  • Please log in to reply
5 replies to this topic

#1 robertstupak

robertstupak

    Newbie

  • Members
  • 5 posts

Posted 14 July 2011 - 03:35 PM

Hello, I've managed to bold a text widget menu item in the side bar when the current page is active using this: ` .widget ul li.current_page_item a { color: #000000; font-weight: bold; } ` as on this main FAQ page:

Please Login or Register to see this Hidden Content

However, when I am a single FAQ subpage - e.g.

Please Login or Register to see this Hidden Content

- the main FAQ page menu item in the sidebar widget gets de-selected. Which selector should I use to make sure that the main FAQ page menu item in the sidebar widget remains blackened and bolded when I am on any of the FAQ subpages? Thanks, Robert

#2 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 14 July 2011 - 06:27 PM

sorry but what Item should be highlighted when you are on the sub page? so i know what to look for

#3 robertstupak

robertstupak

    Newbie

  • Members
  • 5 posts

Posted 14 July 2011 - 07:09 PM

Hello Adam, When you go to the main FAQ page at

Please Login or Register to see this Hidden Content

, you will see that one of the sidebar menu links on the left is blackened and bolded - this is the main FAQ page which list all the questions as you can see. However, when you click on any of the questions - e.g.

Please Login or Register to see this Hidden Content

- you will see that the main FAQ page link in the sidebar menu is no longer highlighted. In short, I'd like to keep the main FAQ page link in the sidebar menu on the left highlighted for every FAQ answer page (that are actually sub-pages to the FAQ category pages which are sub-pages to the main FAQ page): FAQ main page - FAQ category 1 -- FAQ answer 1 -- FAQ answer 2 ... - FAQ category 2 ... etc. In other words, I am trying to be able to select the main FAQ page link in the sidebar menu on the left from any of the sub- and sub-sub- pages below so that it remains highlighted for all sub-pages. Hope this helps. Thanks, Robert

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 15 July 2011 - 02:20 AM

you will see that the main FAQ page link in the sidebar menu is no longer highlighted.


Since this main FAQ page link isn't in the sidebar menu, it can't be highlighted. I don't see it in the menu when I go here:

Please Login or Register to see this Hidden Content



Or maybe I am misunderstanding and thinking that you want the main FAQ page link put in there...

#5 robertstupak

robertstupak

    Newbie

  • Members
  • 5 posts

Posted 15 July 2011 - 03:50 AM

Hi Catrina, When you go to

Please Login or Register to see this Hidden Content

, the main FAQ page link is the 3rd one from the bottom in the sidebar menu (it's called: "Najczestsze pytania") - at this moment it's not highlighted because I don't know which selector to use while on a sub-page. And this is where I need your help? I can easily get it highlighted when I am on the main FAQ age using `.widget ul li.current_page_item a` selector. The whole question is how to keep it highlighted when you are on the sub-page (e.g.

Please Login or Register to see this Hidden Content

) - which selector should I use? Thnx, Robert

#6 robertstupak

robertstupak

    Newbie

  • Members
  • 5 posts

Posted 15 July 2011 - 04:14 AM

Hello everyone, I've done it! After many attempts I have finally found the selector that will keep your parent page link in the sidebar widget menu highlighted on any of the subpages: ` .widget ul li.current-page-ancestor a, .widget ul li.current_page_item a, .widget ul li.current-page-ancestor ul a, .widget ul li.current_page_item ul a { color: #000000; font-weight: bold; } ` Just sharing this with everyone in case anyone else has a similar problem. Robert