Skip Navigation

[Resolved] Can't create external link with URL or text field.

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.

This topic contains 3 replies, has 2 voices.

Last updated by Beda 6 years, 8 months ago.

Author
Posts
#878238
Screen Shot 2018-05-11 at 11.08.32 AM.png

I am trying to: Create an external link in a post type that is displayed on the post page.

Link to a page where the issue can be seen: hidden link

I expected to see: the link point to the desired website

Instead, I got: an internal link with the link I entered into the field appended on it. primetime.org is just an example link (to the old website)

#878265

I tried solutions on this issues:
https://toolset.com/forums/topic/custom-url-field-appends-url-to-site-url/
but am still getting an issue...

#878343

I just figured out that this only happens when http(s):// isn't included... if it is, it works as expected. I'm not sure if this is regular wordpress behavior or toolset doing something.

#879004

As Luo explains, standard URL values begin with HTTP/S.

You should be able to solve this issue by crafting the Link manually and populating it with the raw value of the field.

You can as well validate the URL on input, so it will not even be saveable without HTTP/S.

However, I think the easiest solution is to make 100% sure you always use the same (with or without HTTP/S) and then output the raw value of your URL into an "a href" like this:

<a href="[types field='your-url-field' output='raw'][/types]">This is the Link text</a>