Okay
  Public Ticket #2904856
Secondary Header Link
Closed

Comments

  •  15
    Laura started the conversation

    Is there a way to set the secondary header bar link to open in a new tab? I've tried adding target="_blank" after the link to see if that could make it work, but that just creates a 404 error. Currently, our site is linking to an external webpage, and I'd like it to direct users to a separate tab so they don't navigate away from the primary site.

  •  2,960
    Andrew replied

    Hi Laura,

    Try using the following script. Place it at Salient Options > General Settings > CSS/Script Related

    <script>
    window.onload = function()
    {
        var allLinks = document.querySelectorAll("#header-secondary-outer .nectar-center-text a");
        for(var i=0;i<allLinks.length;i++)
        {
            var currentLink = allLinks[i];
            currentLink.setAttribute("target","_blank");
        }
    }
    </script>
    

    Regards,

  •  15
    Laura replied

    That did it!! Thank you so much!