MattTheDesigner
-
Posts
2 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by MattTheDesigner
-
-
On 4/5/2021 at 6:38 PM, creedon said:
This solution requires the business plan or above.
Add the following to Settings > Advanced > Code Injection > HEADER.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Add the following to Blog Settings > Advanced > Page Header Code Injection for the blog page.
<script> $( ( ) => { /* change blog listing item image URL to Source URL SS Version : 7.0 Templates : Brine ( Aria, Blend, Cacao, Clay, Fairfield, Feed, Foster, Greenwich, Hatch, Heights, Hunter, Hyde, Impact, Jaunt, Juke, Keene, Kin, Lincoln, Maple, Margot, Marta, Mentor, Mercer, Miller, Mojave, Moksha, Motto, Nueva, Pedro, Pursuit, Rally, Rover, Royce, Sofia, Sonora, Stella, Thorne, Vow, Wav, West ) */ let targetAtttributeValue = ''; /* use _self | _blank | _parent | _top | framename see < https://mzl.la/2Q0JROF > */ // do not change anything below, there be the borg here if ( ! $( '.BlogList' ).length ) return; // bail if not blog listing page $( '.BlogList-item-title' ) .filter ( function ( ) { return $( this ).attr ( 'target' ) !== undefined; } ) .each ( function ( ) { const $this = $( this ); const url = $this.attr ( 'href' ); let $imageLink = $this .prev ( '.BlogList-item-image' ) .find ( '.BlogList-item-image-link' ) .attr ( 'href', url ); if ( ! targetAtttributeValue ) { const v = $this.attr ( 'target' ); if ( v !== undefined ) targetAtttributeValue = v; } if ( targetAtttributeValue ) $imageLink.attr ( 'target', targetAtttributeValue ); } ); } ); </script>
This is for v7.0 using the Brine template family.
Let us know how it goes.
This is amazing, thank you. Really helpful.
After using your code to change the BlogList-item-image link, I'd love to do the same with the read more button that goes under my article links (BlogList-item-readmore)
Any idea how I'd go about that? Could I reuse the above and just change some parts?Cheers!
Link image in Summary Block to Source URL, in new window
in Customize with code
Posted
Sure, it's just a typical blog collection page (on a brine template)
https://www.safepointapp.com/blog
Thanks,