Jump to content

Changing code on multiple pages by just changing one code block

Recommended Posts

Site URL: https://gardenbarn.co.nz

I'm not sure how to phrase my question, so I'll give an example.
 

On my website I have a custom header (not built using the Squarespace header thing) which has some blocks that are the same across the whole website (the opening hours, and social medias links for example) but other blocks which change across the website (the nav links for example). However, when I want to change something in this header, the opening hours for example, I have to change every page on the website - which there are quite a few.

Is there a way I can change just one of these code blocks which will then change all the blocks on the other pages, perhaps using embeds? I have also tried uploading an html file to my website and then using an embed block to add the code the website, but it creates a scrollbar and cuts parts of it off and just doesn't look right in general.

Thanks

(no password btw)

gardenbarn.co.nz

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

14 hours ago, jimmy5090807 said:

On my website I have a custom header (not built using the Squarespace header thing). Is there a way I can change just one of these code blocks which will then change all the blocks on the other pages, perhaps using embeds?

I recommend that you use the Squarespace header design tools instead of building a workaround for your workaround 😄. It will be so much easier to administer! If you're interested in doing this, can you explain the issues that you had with the built-in header? We can probably solve these issues more easily.

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
  • 2 weeks later...
On 1/14/2022 at 12:26 AM, paul2009 said:

I recommend that you use the Squarespace header design tools instead of building a workaround for your workaround 😄. It will be so much easier to administer! If you're interested in doing this, can you explain the issues that you had with the built-in header? We can probably solve these issues more easily.

Apologies for the super late reply.

When making header using the Squarespace header design tools, I wasn't able to add anything to the header, apart from the logo, navigation links, and social links. However I wanted to be able to add the phone number and opening hours, as seen on my website currently.
I also wanted to make it so the current page the user is on is highlighted, which I couldn't find a way to do using the built in tools.
Another thing was I didn't want the social links to show in the mobile header which I couldn't do using the built in tools (without removing the social links from the desktop header). I realise that I can likely add custom css to fix this, but I didn't bother trying to do this as I couldn't do the other things above.

If you know of a way to fix these that would be super helpful, particularly the first and second issue.

gardenbarn.co.nz

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.