Jump to content
hugo2808

Keep Main Nav Item highlighted after change page

Recommended Posts

hugo2808    1
hugo2808

Hi all!

I'm building a site with a main nav with single items (no dropdown)

 

Consider my nav menu

HOME   EVENTS

 

In EVENTS page, I enter in it and the item events is highlighted, everything OK.

In this page I have a sidebar Menu with a list of events, so my most recent event is the page used in the nav menu for EVENTS item, I mean, when I click on menu item EVENTS i got to the page of my last event!

 

When I change event in the side bar menu, I go to another event page but I would like to keep the EVENTS item of main nav highlighted (has if I hadn't changed page)

 

Is it possible?

 

Thanks

 

Hugo

Share this post


Link to post
Share on other sites
catrina    103
catrina

You’ll need to use Custom CSS (in Site Options > Custom Code > Custom CSS/LESS). To find the Custom CSS you need, you'll need to use Firebug (or Chrome Development tools). To learn how to use Firebug for CSS customizations, please review this entire documentation and follow the instructions: http://support.pagelines.me/docs/customization/custom-css. For help with the link attribute, please see these instructions: http://www.w3schools.com/css/css_link.asp. To be more specific, you need to use the <li> class .current_page_item in your CSS selector so that your CSS change is applied to the current/active page link.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

Hi, thanks for your help.

I was trying to do it on style.css of Customize Plugin.

So changes must be done in the Framework directly has you said!

The problem is that I really change page when I click on one item in my side bar menu, and I cannot make reference to the item of my nav bar in order to don't loose highlight.

 

Thanks

 

Hugo

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi Hugo,

 

So if I understand you correctly, you have created a menu item called events, is this a page/post/category or a custom post type ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

Hi Danny,

I've created a item in the main nav called EVENTS that is a page.

This page is the last event I have (chronologically)!

 

When I enter in the page (called by the main nav item EVENTS) I have a side bar menu with all the events I have.

Off course the main nav EVENTS is highlighted because I'm in his page, but when I choose another event from side bar menu and change event I loose the main nav item EVENTS highlight because I change page.

I would like to have the main EVENTS highlighted in all my events pages, and not only in the one that references the main menu item EVENTS.

 

I can put all other events pages has child's of my reference page, but I can't still block the main nav for highlight.

 

Thanks

 

Hugo

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

OK, if other events from the sidebar menu are also pages, make these pages child pages of the events page, this should resolve the issue.

 

Also, would it be possible for you to provide a link to the site in question please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

I still don't have it online, soon will!

Child pages are not in the main nav, shall I put the there?

 

Or is any css to reference the parent page?

 

Where should I put the css, in the stule.css of customize pluging, or in the Site Options > Custom Code?

 

Thanks

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there,

 

Yes, following what Danny said if you put the child pages into the nav this should resolve the problem for you.

 

You can also set the active state of a menu item using css within a sidebar menu item or within the main nav. You can place that css into the style.css of the customize plugin if that's what you're using, it will still work.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

Hi,

I've putted all the events pages has child of my reference page in main nav menu, and I configured the css for .main-nav .current-page-ancestor a  and now I have the expected result, all event pages highlight the EVENTS menu item.

 

This is possible not the best solution, but it works!!

 

Thanks all 

Share this post


Link to post
Share on other sites
James B    436
James B

If it works that's all good :-)

 

Glad you got it working.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

Now I'm facing a second issue in the same problem.

The pages of the side bar menu have post loops inside, and when I enter in a single post the menu looses highlight.

I've seen that is because the reference from a post to a page is not native!

Is there any possible way to do it, highlight a menu item from a post?

 

Thanks for your precious help!!

 

Hugo Dias

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi Hugo,

 

If the post is configured in the menu as a child item for your page, then it should work like this:

http://d.pr/i/qAPp

On the image above, the Sample Page menu item has the Test Post 3 post set like this, in the Wordpress Custom Menu.

 

Sample Page
    Test Post 3

So it should work automatically.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

Hi,

the post isn't configured in the menu!

I would like to make something like: "highlight a menu item if the post page displayed is from a certain category"!

 

Is it possible??

 

Thanks

 

Hugo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • Anthony CALCI
      By Anthony CALCI+
      Hello,
      I have switched from the Framwork theme to DMS theme on http://calcipatrimoine.theproofingcompany.fr (miror site of http://calci-patrimoine.com).
      But I have now only the Primary sidebar in the Widget section ! Secondary sidear, Footer sidebar have all disapear...
      Can I have help to have them back ?
      Regards,
      Anthony
    • khat
      By khat+
      I think I may have installed pagelines pro incorrectly, and then used features incorrectly. I installed first platforms framework theme and then the child, thinking I could do setup for child later. I tried to set up a background image, and tried custom css feature in pagelines dashboard. I had mistakes in my css, and just thought that if I deleted the info in the css custom feature in pagelines dashboard that the new information would overwrite the old info. The background image didn't respond at all, probably because I didn't have the child directory renamed. I then tried to use the LSS plugin to create css and added more css, possibly, somewhere -sigh-. I never did change the background image and get it placed properly. I used a workaround and in nested containers I placed a background image which worked well enough, so I moved on to try to create my nav bar/ menu bar. When I go to the Menus panel, there is NO area where I can place a menu on a page. I have read and reread and re- re- reread the instructions for placing a menu. I've used the pagelines editor to place a menu, however only HOME shows up. I've been at this for many hours. I've since uninstalled all of my pagelines items and reinstalled, thinking that it would restore all my changes to default, but no, it is still all there, with all my unresolved issues. I am completely at a loss as to what to do next.
    • Jarek
      By Jarek+
      How to make the Impulse menu sticky?
      Here is a site that seems like it is doing just that: http://www.manhattanperiodontist.com/
      Here is the site I am working on: http://boeriu.digitalvector.com/ 
      I have no problem showing the menu at the bottom, but when scrolling up it does not stick.  I tried to add Nav Pro menu but when I do that, it just shows on top and no matter what I try is not working as I want it to.
      Any suggestions?
    • Dave
      By Dave+
      1) Toggle menu on mobile devices does not work properly, combination Chrome 56.0.2924.87 with Android 6.0.1

      2) Mobile / Default Menu > Set the primary/default navigation for your site. This will be used in the pop out mobile menu and as the default in navigation sections. Does not work.
    • David
      By David+
      We are building a long-page scrolling site with Pagelines 5. Our menu is made with # links that go to a container's unique ID, e.g. container_ux7al6g
      This works, but it doesn't look great in the menu. Is it possible to assign a 'nice' # link, e.g. /#solutions ? 
      We used to do this in the DMS2 platform through a workaround, but that doesn't seem to be possible now. 
      Any suggestions? 
×