The Short Answer
Use the following JSON-T tags:
{website.baseUrl}{fullUrl}
The Details
I’ve been doing a lot of SquareSpace development projects recently (PS: Never thought I’d hear those words coming out of my mouth…err, my fingers…but more on that another time). In one of said projects, I was beefing up the blog, adding some beautiful social sharing buttons to take the place of the vanilla SS “Share” menu. However, I ran into a problem: the tag in this particular template—Montauk—called {fullUrl}
wasn’t the full URL. It was a relative URL. Obviously, I couldn’t use a relative URL for sharing on social media, so I had to snoop around and figure out exactly how to fetch the actual full URL for each post.
The first place I went was Google. When a few quick searches didn’t turn up anything, I checked out the underlying JSON for the blog collection. Every page on a SquareSpace website has a JSON object responsible for delivering content to the template files, which in turn take this content and display it to the end user. You can view any SS page’s JSON by tacking on ?format=json-pretty
to the end of the URL in your browser’s address bar. I did exactly that; as I had originally noted, the fullUrl
property of each blog post was indeed a relative URL. However, I did notice that the parent website
object that held all of the information about the site in general had a couple of properties that could help, one being baseUrl
.
I tried {baseUrl}{fullUrl}
to no avail. For a few minutes, I was pretty stumped that that didn’t work. I reviewed the blog.list
collection file a bit more, thought it over, and realized I was trying to call the baseUrl
property of the collection instead of the baseUrl
property of the website. Simply appending website.
to baseUrl
gave me exactly what I needed, and I was able to get the gorgeous new share buttons functioning flawlessly.
There’s a lesson here, fellow programmers: know your coding fundamentals. I recognized the issue because I was familiar with object notation (that’s what the ON in JSON stands for, by the way), but if I wasn’t, I could have spent hours trying to fix a relatively simple problem. The fundamental principles of programming don’t change much from language to language, so having a sturdy foundation of knowledge ensures you can pick up new languages with relative ease.
Get Technically Speaking with Megan

Leave a Comment