Skip Navigation

[Resolved] Opening a PDF link in a new tab

This thread is resolved. Here is a description of the problem and solution.

Problem:
The issue here is that the user wanted to open his PDF file in a new tab.
Solution:
The solution to this can be seen below. Its to wrap the pdf file output in an anchor tag.

<a href="[types field='select-your-chosen-pdf' output='raw'][/types]" class='w-btn style_solid color_primary icon_none standard-button' target='_blank'>View Policy</a>
This support ticket is created 6 years, 8 months 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.

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 1 reply, has 2 voices.

Last updated by Shane 6 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#632313

Hi,

I have custom post type set with a custom field for a PDF file upload.

In the view, I'm trying to get the PDF link to open in a new tab, my current Views layout is as follows:

<wpv-loop>
<div class="document-boxes">
<h2 class="document">[wpv-post-title]</h2>
[types field='select-your-chosen-pdf' link='true' title='View Policy' class='w-btn style_solid color_primary icon_none standard-button'][/types]
</div>
</wpv-loop>

I've tried adding: target="_blank" to the types field: 'select-your-chosen-pdf', which hasn't worked unfortunately.

How can I go about integrating this?

Thanks!

#632630

Shane
Supporter

Languages: English (English )

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

Hi Paul,

Try doing it like this.

<a href="[types field='select-your-chosen-pdf' output='raw'][/types]" class='w-btn style_solid color_primary icon_none standard-button' target='_blank'>View Policy</a>

Please let me know if this helps.
Thanks,
Shane