Jump to content

Adding categories to main navigation

Go to solution Solved by tuanphan,

Recommended Posts

I know I can just add links to the main navigation to go to categories but my issues is it won't show those pages as active because it considers them external links. There is a button in store settings> categories> that says "add to main navigation" (see attachment for reference screenshot) but it doesn't do anything/ doesn't work when clicked. 

Any insight would be much appreciated. 

Thank you!

Screenshot 2023-06-10 at 10.49.40 PM.png

Link to comment
  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
On 6/21/2023 at 10:23 PM, mister_nar said:

Sorry for the delay. here is the link

https://narmfg.com

 

Thank you!

You mean make these underline when users on?

image.png.e69224b2babbf042576d7a8c426211c9.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
14 hours ago, mister_nar said:

Yes.

Try adding this code to Last Line in Code Injection > Footer

<script>
if (document.location.pathname.indexOf("/shop/manufacturing") == 0) {
    document.querySelector('body').classList.add('t-active')
}
 if (document.location.pathname.indexOf("/shop/supply") == 0) {
    document.querySelector('body').classList.add('t-active')
}
  </script>
<style>
  t.active header#header [href*="/shop/manufa"], t.active header#header [href*="/shop/supply"] {
    border-bottom: 1px solid;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • Solution
On 6/26/2023 at 1:21 AM, mister_nar said:

hmmmm I've the code in there but it doesn't seem to be working. 

I miss a - symbol. Use this new code

<script>
if (document.location.pathname.indexOf("/shop/manufacturing") == 0) {
    document.querySelector('body').classList.add('t-active')
}
 if (document.location.pathname.indexOf("/shop/supply") == 0) {
    document.querySelector('body').classList.add('t-active')
}
  </script>
<style>
  body.t-active header#header [href*="/shop/manufa"], body.t-active header#header [href*="/shop/supply"] {
    border-bottom: 1px solid;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 4 weeks later...
On 7/23/2023 at 6:46 AM, TRBZINK said:

i am having the same problem, with categories not showing in the header, the solution above is not working? and i configured the code to use the /shop/abode like my site categories. https://conch-platinum-mf8h.squarespace.com/

 

What is access password?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

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


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.