Welcome to WebmasterWorld Guest from 50.16.117.44

Forum Moderators: ergophobe

Message Too Old, No Replies

Adding common footer links by including an html file in SquareSpace

how do I do a file include in SquareSpace

     
12:36 am on Jan 14, 2016 (gmt 0)

New User

joined:Jan 14, 2016
posts: 2
votes: 0


I have pages with the same links in the footer. If the client wants to change the link, I want to be able to just change it once in an uploaded file and have the footer do a call to that file to insert the code for the links. Does anyone know how to do this in SquareSpace?
1:23 am on Jan 14, 2016 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8418
votes: 201


I haven't used Squarespace, but I have used Shopify, Weebly and some others. They're all similar in that they all have their own templating language. It's unlikely that you would upload an actual .html file, but probably some "partial" that gets included.

They have SFTP and git transfer methods.
[developers.squarespace.com...]
6:59 pm on Jan 16, 2016 (gmt 0)

New User

joined:Jan 14, 2016
posts: 2
votes: 0


If anyone else wants to know how to do this, I found an alternate method. I ended up using JQuery instead. I put it in the Settings>Advanced>Code Injection section.

In the header section I added :
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
This allows you to use JQuery on your site

In the footer section I added :
<script> $("#includedContent").html("<center> - : : <a href='../page'>Go to Page</a> : : -");</script>
This looks for the ID of includedContent and inserts the html code between the DIV. Single quotes must be used in the line of code.

Then in the footer section of each page I wanted the "Go to Page" code to appear I inserted :
<div id="includedContent"></div>
This is where I want the code to appear. Yours does not have to be in the footer,. It can go anywhere you can insert a code block.
7:21 pm on Jan 16, 2016 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8418
votes: 201


Thanks for posting a solution!

So are you saying that Squarespace doesn't have an overall page template and a server-side template file that can be used to define the footer? Or if not for the footer, I thought Squarespace had something called Blocks that could be used for repeating content.

In any case, if you set up git using hte link above, it will make this incredibly easy to maintain.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members