+ Start a Discussion
Ranjith PunneliRanjith Punneli 

URL inside a field

Hi,

 

I need to display various kinds of below data in a vf page.

 

<link to articles><User friendly name><some texts> 

<some texts><link to articles><User friendly name><some texts>

<some texts><link to articles><User friendly name>

 

I created a text area field and updated data as 

<a href="<link>" target="_parent">Learn more</a> and get excited to enhance your skills!

However, when I try to display this in vf, it is exactly coming as what i have given, not as a url link. 

 

any suggestions?

Best Answer chosen by Admin (Salesforce Developers) 
Daniel HaselhanDaniel Haselhan

If you are using <apex:outputText> to print out the TextArea field you are using, you can add a tag, escape="false". This tag prevents salesforce from escaping whatever is output, so any HTML in the field will be rendered.

<apex:outputText escape="false">URL_FIELD</apex:outputText>

 

Alternatively, you can switch the text area to a formula field and use the HYPERLINK function.

HYPERLINK(
"http://newssearch.bbc.co.uk/cgi-bin/search/results.pl?scope=newsifs;tab=news;q="&Name, 
"BBC News")

As seen on this page:

https://login.salesforce.com/help/doc/en/useful_advanced_formulas.htm

 

Hope this helps!