Greetings!
I have a client with a Flickr photo gallery. They have a redirect link in the top nav of their nation which goes right to the gallery. It is an established design pattern for links to external sites open that external page in a new window or tab. My client wants to follow suit.
I am unable to figure out this option from the CRM:
So, what's the secret? How do I add a target="_blank" to redirects?
As Austin mentioned in the comments below, you can go into the _nav.html file of your website theme and wrap all of the liquid variables for links in "IF" statements that check to see what page type they are. For example:
Before:
<a href="{{ child.url }}">{{ child.name }}</a>
After
<a href="{{ child.url }}" {% if child.type_slug == 'redirect' %}target="_blank" {% endif %}>{{ child.name }}</a>
This will make sure that any redirect pages in the Top Nav open in a new tab. You can also make this change in other places throughout your theme. For example, to achieve the same result in your sidebar, you can edit the _supporter_nav.html file and the _columns_2.html file.
Showing 3 reactions
Sign in with
Certified Architect
Certified Expert
Certified Developer
{% if child2.type_slug == “redirect” }target="_blank"{ endif %}
Note: “child2” can be “child”, “post”, “page”, etc depending on where your link is.
Though I should note, I have had cases where I can’t use this code (because for whatever reason there are internal links that are redirects). But in many cases, especially with subnav buttons, it’s worked well.