BrownKatUK Posted December 30, 2020 Share Posted December 30, 2020 Site URL: https://earthworm-octahedron-jelm.squarespace.com/ I have been reading older posts about using Code Blocks to add a superscript. The company I am working with has a ® at the end of their name. The site is pretty much built and now I need to figure out how to turn every ® in body copy and headlines to a superscript. Is there any easy way to do this with code block? When I tried by adding .. <p>TommyBars<sup>®</sup> text.</p> I basically ended up with the code block showing the right thing and nothing else. I really don't want to go back and redo all the type in multiple markdown blocks. Thanks so much. Katherine Website: https://earthworm-octahedron-jelm.squarespace.com/ Password: TBZigg3 Link to comment
tazmeah Posted December 30, 2020 Share Posted December 30, 2020 (edited) You could try this in your footer Code Injection. <script> /* superscripting all ® which aren't already */ window.addEventListener("DOMContentLoaded", function(){ document.querySelectorAll("p, a, h1, h2, h3, h4, h5, h6, label").forEach(function (el) { el.innerHTML = el.innerHTML.replace(/®(?!\<\/sup)/g, "<sup>®</sup>"); }) }); </script> Edited December 30, 2020 by tazmeah added labels squarecoder 1 Link to comment
BrownKatUK Posted December 31, 2020 Author Share Posted December 31, 2020 That worked!! Thanks so much. tazmeah 1 Link to comment
BrownKatUK Posted January 4, 2021 Author Share Posted January 4, 2021 Hi @tazmeah. It's me again. You have been so helpful and I am hoping you might be able to resolve a problem with the code above for the superscript. The code does exactly what I need in terms of the registration superscript for for some reason it then deletes the two gallery blocks (film photos and media logs) below the testimonial gallery block. I tried deleting the gallery blocks below and adding them as a new section and that didn't work. Basically anything below the testimonial was blank. Do you have any idea why? Thanks so much. I am new to SquareSpace and on a big learning curve and this forum and people like you have been so helpful. It is very much appreciated! Link to comment
tuanphan Posted January 6, 2021 Share Posted January 6, 2021 On 1/4/2021 at 6:26 PM, BrownKatUK said: Hi @tazmeah. It's me again. You have been so helpful and I am hoping you might be able to resolve a problem with the code above for the superscript. The code does exactly what I need in terms of the registration superscript for for some reason it then deletes the two gallery blocks (film photos and media logs) below the testimonial gallery block. I tried deleting the gallery blocks below and adding them as a new section and that didn't work. Basically anything below the testimonial was blank. Do you have any idea why? Thanks so much. I am new to SquareSpace and on a big learning curve and this forum and people like you have been so helpful. It is very much appreciated! Do you still need help? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
BrownKatUK Posted January 7, 2021 Author Share Posted January 7, 2021 @tuanphan Yes please re: superscript. Link to comment
tuanphan Posted January 9, 2021 Share Posted January 9, 2021 On 1/7/2021 at 6:35 PM, BrownKatUK said: @tuanphan Yes please re: superscript. Can you duplicate page, add code there, share duplicate page url, we can check easier? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
BrownKatUK Posted January 9, 2021 Author Share Posted January 9, 2021 Hi @tuanphan. Do you mean add the superscript code that was creating the issues. That code was added as a code injection in the footer. If yes. Would it be easier to duplicate the site and do what you ask as the code applies throughout the site. As always, I very much appreciate your continuing help! Link to comment
mattematissen Posted March 19, 2021 Share Posted March 19, 2021 @tazmeah I came across this thread and your solution helped me solve my issue to some extent, but I hope you can give some additional guidance. I'm using the ® in the title for a range of products. When viewing the product in detail the ® is superscript, but when looking at the products overview/product grid, it's not. Is there something that can be added to the code to achieve it here also? Thanks for your help! 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