How to render CCK URL field as a link, not just text?

tmallen - December 16, 2007 - 05:16

For one content on my site, I allow users to upload a link to their website (a gallery of users' personal sites, essentially). But the content type displays this field just as plain text. How can I make these URLs display automatically as links?

Extra Credit: Is there a way to validate user input in this field to make sure that they actually have entered a link? Or would that be a bad idea since there are so many ways to write a URL (using an IP instead of a domain, etc.)?

You could use Contemplate

Christefano - December 16, 2007 - 09:03

You could use Contemplate to add the <a href=""></a> part to the display of your content type's custom link field, but if you're using D5 then the included URLfilter input filter should be turning the URL into a link. Is the URLfilter module working for other posts?

For the extra credit part, you could be using the Link CCK field module to do the validation.

URLFilter is reliably

tmallen - December 16, 2007 - 11:29

URLFilter is reliably changing URLs from the body text into links, but not in this custom field (type set as Text).

link field?

sime - December 16, 2007 - 11:32

Are you using Link Field?

 
 

Drupal is a registered trademark of Dries Buytaert.