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

Display Code on Your Site Without it Being Read as Code


Question

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.

Link to post
  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular 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 Sear

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 work

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. 

Posted Images

4 answers to this question

Recommended Posts

  • 0
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

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digitalbuilding the features that Squarespace didn't include. Pick dates in any format, show prices in other currencies, take orders without payment or improve your cartI value honesty, integrity, transparency and respect. Links in my posts may refer to SF Digital products or may be affiliate links.  Squarespace. I've been a loyal supporter of the platform since 2007. 

Link to post
  • 0
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

Link to post
  • 0
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.

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digitalbuilding the features that Squarespace didn't include. Pick dates in any format, show prices in other currencies, take orders without payment or improve your cartI value honesty, integrity, transparency and respect. Links in my posts may refer to SF Digital products or may be affiliate links.  Squarespace. I've been a loyal supporter of the platform since 2007. 

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