taycw Posted February 27, 2021 Share Posted February 27, 2021 (edited) I am trying to make the text "Notes, Queries and Explanations" at the top of the individual blog posts a link back to the home blog page. The text is currently added using the content attribute and am having trouble working out the javascript. What can I do to make that a link? Edited February 28, 2021 by taycw Link to comment
creedon Posted February 27, 2021 Share Posted February 27, 2021 Add the following to Blog Settings > Advanced > Page Header Code Injection for the blog page. <script> $( ( ) => { /* begin add linked text to blog title SS Version : 7.0 Template : Brine family */ const text = 'NOTES, QUERIES AND EXPLANATIONS'; const url = '/notes-queries-and-explanations'; // do not change anything below, there be the borg here $( '<a>' + text + '</a>' ) .attr ( 'href', url ) .prependTo ( '.BlogItem-title' ); // end add linked text to blog title } ); </script> This is for a v7.0 site using the Brine template family. You can retarget your CSS from .BlogItem-title:before to .BlogItem-title a and make the minor adjustments needed. Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
taycw Posted February 28, 2021 Author Share Posted February 28, 2021 16 hours ago, creedon said: Add the following to Blog Settings > Advanced > Page Header Code Injection for the blog page. <script> $( ( ) => { /* begin add linked text to blog title SS Version : 7.0 Template : Brine family */ const text = 'NOTES, QUERIES AND EXPLANATIONS'; const url = '/notes-queries-and-explanations'; // do not change anything below, there be the borg here $( '<a>' + text + '</a>' ) .attr ( 'href', url ) .prependTo ( '.BlogItem-title' ); // end add linked text to blog title } ); </script> This is for a v7.0 site using the Brine template family. You can retarget your CSS from .BlogItem-title:before to .BlogItem-title a and make the minor adjustments needed. Let us know how it goes. Thanks! That did the trick! creedon 1 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