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.


If a response has helped you, please give thanks using the  like-20-mag.png.3997345d620e40b4760b5d7a667cad54.png button.
Need personalised help? I'm a professional Developer who works with Designers internationally. You can book me via my company's website. www.sf.digital

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...