Jump to content

Table URL Field Type: Add a Destination URL on Output?


Tiffany Janisch
 Share

Recommended Posts

Hi, I created a table and have a column using the URL field type; how do I add a ahref tag via the API so that on the output, the URL is clickable? Below is the section of code and any suggestions would be great as I'm a newbie! :-[

foreach($page->tbl_CompanyURLs as $c_url) {
  if($c_url->url_company) echo "$c_url->url_company<br />";
  if($c_url->url_updated) echo "$c_url->url_updated <br />";          
  }

Cheers,

Tiffany

Link to comment
Share on other sites

Hi Tiffany - is this what you are looking for?

foreach($page->tbl_CompanyURLs as $c_url) {
   if($c_url->url_company) echo "<a href='{$c_url->url_company}'>$c_url->url_company</a><br />";
   if($c_url->url_updated) echo "<a href='{$c_url->url_updated}'>$c_url->url_updated</a><br />";          
}
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...