adriannexo Posted July 19, 2021 Share Posted July 19, 2021 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 Beyondspace 1 Link to comment
Solution Beyondspace Posted July 20, 2021 Solution Share Posted July 20, 2021 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 adriannexo 1 Greeting, it's 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, Lightbox Studio pluginIf 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
adriannexo Posted July 20, 2021 Author Share Posted July 20, 2021 THANK YOU!! This means SO much, I've been trying to figure this out for days and I just felt a massive relief when your code worked!! Bless!!!! Link to comment
adriannexo Posted July 21, 2021 Author Share Posted July 21, 2021 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 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment