ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

URL & IF issue

July 25, 2010 4:47am

Subscribe [4]
  • #1 / Jul 25, 2010 4:47am

    Steve Fairhurst

    168 posts

    I have created a custom field call {product_buy_url} on the page where I use this I have a little piece of code as follows:

    {if product_buy_url}
    <a href="http://{product_buy_url}">Buy Here</a>
    {/if}

    It is sat inside my entries with the correct weblog, and it sort of works. The result is that the URL gets printed on the page rather than being a link behind “Buy Here”.

    Any ideas why this might be?

  • #2 / Jul 25, 2010 4:57pm

    Greg Salt

    3988 posts

    Hi Steve,

    Please check that the formatting for this custom field is set to None.

    Cheers

    Greg

  • #3 / Dec 14, 2010 3:12pm

    jcollinsmedia

    25 posts

    I have a similar question related to using custom field variable with an “href” property. I can’t get this to work:

    <a href="http://maps.google.com/big/long/link?q={custom_field_variable}">Get Directions</a>

    Is this possible on 1.7.x? Thanks for your help!

  • #4 / Dec 15, 2010 4:24am

    John Henry Donovan

    12339 posts

    jcollinsmedia,

    When you say you can’t get it to work, what is happening at the moment?
    What type of custom field is it?

    Have you set Automatically turn URLs and email addresses into links? to no in your specific Weblog preferences

    Admin > Weblog Administration > Weblog Management > Edit Preferences

  • #5 / Dec 15, 2010 9:54am

    jcollinsmedia

    25 posts

    Fixed - thank you!

  • #6 / Dec 15, 2010 4:57pm

    Ingmar

    29245 posts

    Excellent 😊 Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases