Say I have a custom field "URL" for each entry and I want them to be redirected to these specific URLs instead of Craft's.
Similar to WordPress "Page Links To" plugin. http://wordpress.org/plugins/page-links-to/
Can I do this in Craft?
Say I have a custom field "URL" for each entry and I want them to be redirected to these specific URLs instead of Craft's.
Similar to WordPress "Page Links To" plugin. http://wordpress.org/plugins/page-links-to/
Can I do this in Craft?
Instead of using a redirect, what about using the saved URLs directly with your links?
Let's say it's a channel with the handle myExternalLinks
where you collect the links. The actual URL is entered into a field with the handle myLinkUrl
.
This is the template code to list the links:
{% set links = craft.entries.section('myExternalLinks') %}
{% for link in links %}
{#
# Link to the URL entered into `myLinkUrl` instead of
# linking to `entry.getUrl()` and then using a redirect on that entry template
#}
<a href="{{ link.myLinkUrl }}">{{ link.title }}</a>
{% endfor %}
Use this redirect
tag in the template of your entries. Without any plugin! :)
{% redirect entry.myUrlFieldName %}
<a href="entryUrl"...
to link to that entry and then the visitor is redirected from that entry page to the URL you actually want him to see. My question is, why don't you use that URL in the actual link?