Jump to content

General coding question - index page vs sub pages

Recommended Posts

Posted

Does code injected to an index page header affect all its subpages?

More concretely, my site is bilingual and I have code that hides the secondary (language 2) navigation bar items when visiting the language 1 version, and vice versa:

<style> nav.Header-nav--secondary {
 display: none;
 }
 .Mobile-overlay-nav--secondary { 
display: none;
 }
</style>

and

<style> nav.Header-nav--primary {
   display: none;
 }
  .Mobile-overlay-nav--primary {
   display: none;
  }
</style>

Right now, I have that code in both index pages' headers but also injected locally to every single supbpage. Can it be removed from the subpages as long as it stays in the index pages?

Thanks! 

  • Replies 3
  • Views 496
  • Created
  • Last Reply
Posted

Index pages ignore subpages Advanced > Page Header Code Injection. So as long as the index subpages will not be viewed on their own then you can get rid of Page Header Code Injection code for subpages.

Although just as a safety precaution you may want to squirrel away the code in case you need it later! 🙂

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Posted

Mine is a long scroll single page website and subpages are not meant to be viewed indvidually., so I think I'm good there. I do save all my current and old bits of code in text files just in case, though. Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.