Hello everyone. My apologies if something similar has been asked before. I checked around and couldn’t find an answer (lord help me if it was staring me right in the face all along).
Anyway, I’m setting up a site wherein content pages will have a header image. I’ve created a custom field for this header. What I’ve also done is created an alternate header image for ads, as well as a field for the ad link.
{header_image}
{ad_image}
{ad_link}From there, I wrote a conditional so that if the entry doesn’t have a header image, it will instead display the ad image.
{exp:channel:entries channel="news" limit="1" disable="categories|member_data|category_fields|pagination" require_entry="yes" status="open|featured"}
{if header_image == ""}
<a href="http://{ad_link}">{ad_image}</a>
{if:elseif header_image != ""}
<a href="http://{comment_url_title_auto_path}">{header_image}</a>
{/if}
{/exp:channel:entries}Now, the conditional works fine, however the link refuses to work. I’ve set the Field Type to Text Input and Textarea without any difference. Likewise, I’ve set the default text formatting to None.
(Edit: when I enter the link in the ad_link field, I am not creating an actual link, but rather simply entering the URL.)
But what happens is that (as an example):
<a href="http://www.amazon.com">http://www.amazon.com</a>
"> (BROKEN IMAGE LINK HERE)If I set the conditional to instead point to
<a href="http://{ad_link}">then I get a broken link, but the image appears. (Quick edit, upon changing the template to remove the http://, I made certain that the link I put in the field entry only started at www).
Gotta tell ya, I’m scratching my head on this one. Any help would be appreciated.
Thanks folks.