We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom Field adding anchor tag markup in template

Development and Programming

Raverix's avatar
Raverix
3 posts
14 years ago
Raverix's avatar Raverix

Hello,

I’m trying to modify a template for my site, but for some reason, the custom field that I’m expecting to hold my link’s url, contains the full <a href=’link’>link</a>. All I want is it to have ‘link’ so that my following code would work:

{if '{link}' }<a href="{link}">{/if}

Which results in the following output:

<a href="<a href="http://google.com/">http://google.com/</a>">

You can see a screenshot of how I have the custom field setup here: http://imagebin.org/153759

The full template code looks like this:

{exp:channel:entries
  channel="main"
  disable="categories|category_fields|member_data|pagination|trackbacks"
  dynamic="on"
  limit="1"
  }
      <div class="play-box">{general-largeimage}
       {if '{link}' }<a href="{link}">{/if}
    {if '{image}' != '.' && '{image}' != ''}{exp:imgsizer:size src="{image}" width="1200"} {sized} {/exp:imgsizer:size}{/if}
    {if '{link}' }</a>{/if}
        {/general-largeimage}</div>
    </div>
  </div>
</div>

{/exp:channel:entries}
v2.1.3, Build:   20110405
       
Raverix's avatar
Raverix
3 posts
14 years ago
Raverix's avatar Raverix

http://ellislab.com/expressionengine/user-guide//cp/admin/content_admin/channel_edit_preferences.html

Automatically turn URLs and email addresses into links? - What a terrible feature.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.