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

Adding a header to a "tag page"


adriannexo

Question

Site URL: https://www.adriannexo.com/journal/tag/Travel

I've been trying to figure out a way to add a title or intro onto the blog "tag pages" meaning when a viewer clicks on a tag such as "Drinks", the top of the page will say something like "Drinks".

I thought it used to automatically have an intro that said "Posts in ___". Is there a way to add that back in?

This is one of the tag pages I have. Not sure if CSS or a markdown block is the answer here but I'm hoping someone can help! -- https://www.adriannexo.com/journal/tag/Travel

Link to comment

3 answers to this question

Recommended Posts

  • 1
7 hours ago, adriannexo said:

Site URL: https://www.adriannexo.com/journal/tag/Travel

I've been trying to figure out a way to add a title or intro onto the blog "tag pages" meaning when a viewer clicks on a tag such as "Drinks", the top of the page will say something like "Drinks".

I thought it used to automatically have an intro that said "Posts in ___". Is there a way to add that back in?

This is one of the tag pages I have. Not sure if CSS or a markdown block is the answer here but I'm hoping someone can help! -- https://www.adriannexo.com/journal/tag/Travel

Add this to code injection

<script>
document.addEventListener('DOMContentLoaded', function() {
  if (location.href.indexOf("journal/tag")) {
    var tag = location.href.substring(location.href.lastIndexOf('/') + 1);
    document.querySelector("#block-60f61d06c24cc7419f80222f").innerHTML = "Posts in "+tag;
  }
});
</script>

"#block-60f61d06c24cc7419f80222f" is the block id of an empty text block you added on block page, it shared across tag and category page

image.png.f8b77def32a60b3085840c29e920e002.png

image.thumb.png.9599796778717ae3bf2fb3aca1562bad.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
21 hours ago, bangank36 said:

Add this to code injection

<script>
document.addEventListener('DOMContentLoaded', function() {
  if (location.href.indexOf("journal/tag")) {
    var tag = location.href.substring(location.href.lastIndexOf('/') + 1);
    document.querySelector("#block-60f61d06c24cc7419f80222f").innerHTML = "Posts in "+tag;
  }
});
</script>

"#block-60f61d06c24cc7419f80222f" is the block id of an empty text block you added on block page, it shared across tag and category page

image.png.f8b77def32a60b3085840c29e920e002.png

image.thumb.png.9599796778717ae3bf2fb3aca1562bad.png

 

Hi again! I noticed some tags that are two words such as "Home Tour" appear at "Home+Tour" due to the url. I've been trying to get a Replace() method to work but I haven't had any luck.

I'm essentially just wanting to replace all "+" with "  " (space). Would you happen to know?! 

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