I've built a simple add-on and code event listener based on the tutorial.
it works fine if i just want to replace some text (yes i know i can do this with phrases) however it doesn't when the replace alo includes a xenForo phrase (or variable for that matter).
what i am trying to do is actually add a title tag to the link back to my homepage.
here is my current code:
class Mungo_listener
{
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if($hookName == 'footer_links')
{
$contents = str_replace('>{xenhrase home',' title="here is a friendly title">{xenhrase home',$contents);
}
}
}
so two questions, how can i do this by the method i'm trying.
and
would there be a better way of doing this?
it works fine if i just want to replace some text (yes i know i can do this with phrases) however it doesn't when the replace alo includes a xenForo phrase (or variable for that matter).
what i am trying to do is actually add a title tag to the link back to my homepage.
here is my current code:
class Mungo_listener
{
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if($hookName == 'footer_links')
{
$contents = str_replace('>{xenhrase home',' title="here is a friendly title">{xenhrase home',$contents);
}
}
}
so two questions, how can i do this by the method i'm trying.
and
would there be a better way of doing this?