Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
solomonjki

How do I create a line break in my site title?

Question

Link to my website
I noticed when updating my site today that using <.br.> (minus the periods) has totally stopped working in my site title as a line break and simply displays as normal text. I've replaced it with a | for now. It was never a good solution because it showed up in previews as text as well but at least it worked on the site.So, how do I create a line break now if this code is no longer accepted?

Edited by solomonjki
Initial Revision

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 0

In early September 2018, Squarespace removed the option to add HTML markup to titles. It was something that they never directly supported but that they ‘allowed’. They took a decision to improve the security model by following best practice and they no longer render the code. Here's a workaround using some JavaScript. Add it to the site's code injection footer (in Settings > Advanced > Code Injection > Footer:


<!--- Wrap site title on two lines (c) sf.digital --->
<script>
window.Squarespace.onInitialize(Y, () => {
 var title = document.querySelector('.site-title a');
   title.innerHTML = title.innerText.replace('|', '<br>');
});  
</script>

Let me know how you get on.

-Paul

Squarespace Expert & Professional Developer

Contributors to this forum voluntarily give their time to help you. If we correctly answer your question, please accept the answer by clicking Accept below it (you'll see it when you're logged on). If an answer doesn't help, feel free to ask for more help or wait for other forum users to add their comments and/or answers.

Whenever an accepted answer helps you, please vote it up using the up arrow on the right. This helps other forum users by giving them confidence in an answer.


World-class Squarespace Developer and Squarespace Circle Leader with a strong reputation on the Squarespace Forum.
I'm trusted by hundreds of Squarespace users worldwide, including designers, freelancers, business owners and big agencies.

I can tackle anything from small tweaks to full websites and I'm available for short and long bookings (min. 1 hour).
Book via my website giving as much notice as possible. Note that I'm currently booked until the middle of April 2020.
Prebuilt Squarespace Extensions
Custom Squarespace Extensions: Tell me about the functionality you need

**NEW** Our popular Enquiry Form ExtensionDate Picker Extension and Age Verification Extension are now Squarespace 7.1 compatible.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...