Keyword

Output clickable url in extra fields

  • Geoffroy
  • Geoffroy's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125337 by Geoffroy
Output clickable url in extra fields was created by Geoffroy
Hi there,

I have urls in extra fields and I try to make them clickable.

I am using urllinker.php :

bitbucket.org/kwi/urllinker/

but although the require seems to load and the function seems to work without creating an error, there is no link created. Is there something in k2 extrafield that would strip out the html or linking?

Any other way to detect url in plain text fields and transform them in clickable url? Javascript seems to be a pain to implement smoothly such a function...
require 'UrlLinker.php';

<span class="itemExtraFieldsValue"><?php $thisValue = $extraField->value ;print(linkUrlsInTrustedHtml($thisValue)); ?></span>

Please Log in or Create an account to join the conversation.

  • Geoffroy
  • Geoffroy's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125338 by Geoffroy
Replied by Geoffroy on topic Re: Output clickable url in extra fields
For some reason, when I use that code into any page of Joomla I get :

Warning: preg_match(): Empty regular expression

but on the test page I created it's working fine. Why would the regular expression variable not work? Would joomla or k2 strip away that variable??

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #125339 by Lefteris
Replied by Lefteris on topic Re: Output clickable url in extra fields
Hi. You can use extra fields of type link to achieve what you want.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum