Skip Navigation

[Closed] Using target="_blank" in php API for URL type field

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 10 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

This topic contains 2 replies, has 2 voices.

Last updated by Administrator 10 years, 11 months ago.

Author
Posts
#93623

What is the best way to get the url to open in a new tab or window?

I don't see where "target" is a supported attribute, though it seems that naturally this type of field would need a target attribute??

Any suggestions would be much appreciated.

#93624

Oops! I didn't mention I am using an archive template and the php api to output the content đŸ™‚

#93824

Dear Lavada,

For input any "target" options to link you should create <a> tag with "target" attribute, and set his "href" attribute as your link custom type field value.
For example:

<a target='_blank' href="[types field="url-field" raw="true"][/types]">Link Text</a>

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Victor

The topic ‘[Closed] Using target="_blank" in php API for URL type field’ is closed to new replies.