XF 1.4 Custom user fields , URL clickable

Anton_Bodryachkom

Active member
Hi Forum , is it possible to make clickable URL/link when entered to Custom fields ?
example: TEST URL: https://xenforo.com/community
So https://xenforo.com/community would be hyperlink
c61ebe32fc877361eeef608ce19bff64.png


thnk you
 
Problem is though you can't always assume a URL will be prefixed with http:// (it might be https://) and you can't always assume that www. will work. Adding either of these things technically make it a completely different URL. Also your method won't stop people from adding the http:// or www. again. So that will really break things.

You can't have it all ways. If you want it to be a URL it must be asserted as a valid URL or expect it to be broken.
I checked it and it makes no difference if you use http:// or https:// . And also it works with www. and without www. The problem is, as you say, that when someone adds a http:// (who would do that ? :D), then it breaks it.

Yes, we can't have it all ways. I wish it could be easy to use and displayed in message user info but without being too long.
So, I think I will go with your way then, but I won't display the url, so the message user info doesn't look ugly.
Code:
<a href="{$value}" target="_blank">link</a>
and by having value match requirement url.
 
I apologise it should be:

HTML:
<a href="{$value}" target="_blank">{$value}</a>

{$valueUrl} would be used if it was, for example, some sort of parameter that should go inside a URL. Otherwise the {$value} should be used instead.

That was very helpful! Now, could I use an icon instead of text for the link?

Right now I have this - The member's home page is showing a globe icon on the left, but the Custom Field entry I added IMDB and Music site), are only showing text. Could we show icons?

567abf0020f4edac0ecad2a99881227a.webp

Thanks!
 
Last edited:
Top Bottom