Skip Navigation

[Resolved] Open link in new tab – target-="_blank"

This support ticket is created 8 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Shane 8 years ago.

Assisted by: Shane.

Author
Posts
#385601

I am trying to: create a link that opens in new tab

I visited this URL: hidden link

I expected to see: link from minutes (eg, 16 January 2016) open in new tab

Instead, I got: opens in same window

code I am using: <!-- wpv-loop-start -->
<wpv-loop>
<span class="min-link">[types field="minutes" link="true" title="[types field="date" style="text" format="j F Y"][/types]" target="_blank"][/types]</span>
</wpv-loop>
<!-- wpv-loop-end -->

#385798

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

Thank you for contacting our support forum.

Let me see how best I can assist you with this issue.

Could you try formatting your shortcode to use single quotes within the double quotes like this ?

<span class="min-link">[types field="minutes" link="true" title="[types field='date' style='text' format='j F Y'][/types]" target="_blank"][/types]</span>

Please let me know if this helps.
Thanks,
Shane

#386259

I was so convinced that would work, but still not opening in a new window.

The code i have is now:

      <span class="min-link">[types field="minutes" link="true" title="[types field='date' style='text' format='j F Y'][/types]" target="_blank"][/types]</span>

The output is: <span class="min-link"><a href="hidden link" title="16 January 2016">16 January 2016</a></span>

The page is: hidden link

#387039

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

Thank you for getting back to me on this.

I managed to setup a test of your exact scenario and I was successfully able to allow the link to open in a new tab.

Would it be possible for me to look at it through the backend ?

If i'm not able to find why this is happening then I can write a javascript workaround to manually add the attribute to the links once it's loaded on the frontend.

The private fields will be enabled for your next response.

Thanks,
Shane

#390599

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

Thank you for the credentials, I was able to see exactly what the issue was.

You were using a file upload field. Unfortunately this field does not have a target attribute.

So we would need to use javascript to manually add it.

I added this to your view.

jQuery(document).ready(function(){
        jQuery(".min-link a").attr("target", "_blank");
    });

Please let me know if this helps.
Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.