Jump to content

alym

Member
  • Posts

    16
  • Joined

  • Last visited

Reputation Activity

  1. Like
    alym got a reaction from creedon in Link image in Summary Block to Source URL, in new window   
    Wow, it works! Thank you so much! We will experiment with the blog posts and the summary blocks now that they consistently open up in new windows! Thank you so much!
  2. Thanks
    alym reacted to creedon in Link image in Summary Block to Source URL, in new window   
    The OP doesn't need to do this step.
    Add the following to Settings > Advanced > Code Injection > HEADER.
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> Add the following to Page Settings > Advanced > Page Header Code Injection for the page.
    <script> $( ( ) => { /* add target attribute to summary block anchor tags 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 ) */ /* enter block ids for each block you want to target. an empty array means all will be targeted. the format of each line is a block id. do not include # at the beginning */ const blockIds = [ // '[enter block id here]', // last or only item doesn't get a comma at end of line ]; const targetAtttributeValue = '_blank'; /* use _self | _blank | _parent | _top | framename see < https://mzl.la/2Q0JROF > */ // do not change anything below, there be the borg here if ( ! targetAtttributeValue ) return; const $summaryBlocks = $( '.summary-v2-block' ) if ( blockIds.length ) { $summaryBlocks.filter ( function ( ) { return blockIds.includes ( $( this ).attr ( 'id' ) ); } ); } if ( ! $summaryBlocks.length ) return; $( 'a', $summaryBlocks ).attr ( 'target', targetAtttributeValue ); } ); </script> This is for v7.0 using the Brine template family.
    Let us know how it goes. 
  3. Love
    alym reacted to creedon in Link image in Summary Block to Source URL, in new window   
    Yes ALL the code! The coloring is just the forum software doing syntax highlighting.
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.