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
  • Views 570
  • 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.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.