Jump to content

Display Code on Your Site Without it Being Read as Code

Recommended Posts

I am using a Code Block set to "display source" to showcase several code snippets on a blog site. However, I find that if I have any HTML in these blocks it messes with that post's display on the Search Results page in Squarespace. 

Has anyone else run into this? Is there a way to display code on my site without it being read by Squarespace besides just inputting it as text?

I have contacted Squarespace as I think this is a flaw in their "display source" function. However as soon as you mention custom code, they refuse to help.

Coding Wiz at rebeccagracedesigns.com

📖 Code Encyclopedia for Squarespace: rebeccagracedesigns.com/encyclopedia-of-code

🔥 Free CSS Tutorials: rebeccagracedesigns.com/blog

️ Free Guide to the 41 Most Popular CSS Properties: rebeccagracedesigns.com/popular-css-properties

 

Link to comment
36 minutes ago, rebeccagracedesigns said:

I am using a Code Block set to "display source" to showcase several code snippets on a blog site. However, I find that if I have any HTML in these blocks it messes with that post's display on the Search Results page in Squarespace. 

Can you share the following?

  • a working link to the page (so that we can view it)
  • a screenshot of what you're seeing
  • the code you've added

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 hours ago, paul2009 said:

Can you share the following?

  • a working link to the page (so that we can view it)
  • a screenshot of what you're seeing
  • the code you've added

The page is hidden behind a membership so I cannot share a link to the actual page.

If you go to my blog page at https://www.rebeccagracedesigns.com/blog and use the search bar to search, it works great. However, I do not have any code blocks displaying HTML on that blog. They generally show CSS or Javascript. 

I have a paid blog similar in style to my public blog. However, some of those posts have code blocks displaying HTML. When you use the search on that page, it sometimes looks like the attached photo.

It seems like the search results page is reading the HTML code in the code block. It is then populating all the results in one search results div. I have attached a photo of this as well as one where it is populating properly.

Screen Shot 2021-05-04 at 10.31.44 AM.png

Screen Shot 2021-05-03 at 5.43.29 PM.png

Screen Shot 2021-05-03 at 5.42.41 PM.png

Coding Wiz at rebeccagracedesigns.com

📖 Code Encyclopedia for Squarespace: rebeccagracedesigns.com/encyclopedia-of-code

🔥 Free CSS Tutorials: rebeccagracedesigns.com/blog

️ Free Guide to the 41 Most Popular CSS Properties: rebeccagracedesigns.com/popular-css-properties

 

Link to comment
47 minutes ago, rebeccagracedesigns said:

The page is hidden behind a membership so I cannot share a link to the actual page.

I understand. Unfortunately it's not something I can easily diagnose without access to the page.

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
36 minutes ago, paul2009 said:

I understand. Unfortunately it's not something I can easily diagnose without access to the page.

I found an instance on my public blog. If you go to my blog page at https://www.rebeccagracedesigns.com/blog  and search "html" this is what is coming up for me. 

Screen Shot 2021-05-04 at 12.23.22 PM.png

Coding Wiz at rebeccagracedesigns.com

📖 Code Encyclopedia for Squarespace: rebeccagracedesigns.com/encyclopedia-of-code

🔥 Free CSS Tutorials: rebeccagracedesigns.com/blog

️ Free Guide to the 41 Most Popular CSS Properties: rebeccagracedesigns.com/popular-css-properties

 

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.