Easier way to amend same occurrence in many templates?

arms

Well-known member
I want to amend:

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

To

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

Is there a better way than many template modifications?
 
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:

PHP:
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.
 
Back
Top Bottom