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.

Use one variable as web address of another variable

December 29, 2007 1:12pm

Subscribe [1]
  • #1 / Dec 29, 2007 1:12pm

    teagirl

    17 posts

    Hello,

    I have been trying to get this code to work:

    {if p_url != ""}<a href="http://{p_url}" title="">{/if}{p_name}{if p_url != ""}</a>{/if}

    Where variable p_url is an optional text field in the PUBLISH page and is filled with data such as http://www.site.com

    and variable p_name is a required text field in PUBLISH page that has the name of the link.

    The problem is p_url is a website address so inside href=”” I am getting a whole separate link tag. I want to fit p_url such that is becomes the link of p_name. Is it possible to take the data as it is (http://...) and fill it in href=“http://...” without EE knowing it was a hyperlink?

    It’s something like {url_or_email_as_author} only I want it to be {p_url_as_p_name}?

    Thanks in Advance!

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

ExpressionEngine News!

#eecms, #events, #releases