Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1083487
    Pablo F
    Participant

    Hi,

    How could I enable target=_blank links on Cards only for external links?

    I mean if a link goes to a page within the site opens a self target, if the link opens a page outside the site opens a blank target.

    Iยดve seen and tried another solutions from other posts, but I could make them work.

    PS: It would be a good idea you implement it in further updates creating a field/check for the target behavior. Why not control the links behavior on Cards if you can control it within Cornerstone in the rest of links?

    Kind regards.

    #1084204
    Friech
    Moderator

    Hi There,

    We certainly appreciate the feedback! This is something we can add to our list of feature requests. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive.

    For now you can add this custom JavaScript on your customizer.

    (function($) {
       $( ".external-link .x-face-button" ).attr( "target", "_blank" );
    })(jQuery);

    Then add a class external-link to the card element that has an external link.

    Hope it helps, Cheers!

    #1084573
    Pablo F
    Participant

    Thank you,

    It works like a charm ๐Ÿ˜‰

    #1084780
    Christian
    Moderator

    You’re welcome. Glad we could help. ๐Ÿ™‚

  • <script> jQuery(function($){ $("#no-reply-1083487 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>