Streaming live at 10am (PST)

CMS Link to Parent Nav Bar


#1

I’d like to show the “Real Estate” nav item as ‘selected’ when a user views the individual asset pages.

The first image contains represents the “Real Estate” page; the second image contains an individual asset; however, I’d like the real estate tab in the nav bar to appear as though the user is currently visiting the “Real Estate” page.


Here is my public share link: https://preview.webflow.com/preview/lig-3975eb?preview=8a7b225fc18fa6a9a9f1d8a087af81e4


#2

@seanmu great question!

If you add an ID to your real estate link (say Real-Estate), then you can add a class to it to style the current state.

Let’s call that current state class current

Then add this custom code to your site on the pages where you want the real estate button to be in the current state:

 <script>
$(function() {
  $('#Real-Estate').addClass('current');
});
</script> 

Then this will show up on your published site each time you visit a page and have that configured. :bowing_man:‍♂️


#3

Thanks! I can’t quite seem to get this to work; could you give me a bit more detail?