XF 1.5 Function to decide if target=blank or not

Robert9

Well-known member
I have a field URL and most of times there are external links used with target=_blank,
but sometimes i have also a link that should not open in a new window. Do we have any function that decide that?
I tried with xen:link url, but without effect.

How can i check a part of a string in a temple?
Maybe with wordtrim or is there a better way?
 
When you call xen:link, script execute renderTagUrl function, then XenForo_Helper_String::getLinkClassTarget.
Logic is next:
If link is internal - no target blank
if link is external - target blank.

If you need to change logic, you need to code handler of this function (overwrite function).
 
Thank you.
I have added a smal preg_match and pass a var with 0/1 to decide about target=_blank now.
 
Top Bottom