• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Easier way to amend same occurrence in many templates?


Active member
I want to amend:

{xen:helper threadPrefix, $content}{$content.title}

{xen:helper threadPrefix, $content}{xen:helper threadPrefix2, $content}{$content.title}
Is there a better way than many template modifications?

Chris D

XenForo developer
Staff member
Would it be possible to amend the default threadPrefix helper?

You would effectively be overwriting the helper, I haven't looked at the code but you could start with something like:

public static function helperThreadPrefix($arg1, $arg2)
    $prefix1 = XenForo_Template_Helper_Core::helperThreadPrefix($arg1, $arg2);
    $prefix2 = self::helperThreadPrefix2($arg1, $arg2);

    return $prefix1 . $prefix2;

public static function helperThreadPrefix2($arg1, $arg2)
    // threadPrefix2 code here.
    return '';
So, with that set up, you probably don't need to modify any templates.