abdfahim
Well-known member
Hi,
I want to open a template on an overlay. I used following code to add a button in the sidebar (following Kier's old tutorial). But I don't understand how and where to create "my_custom_template" (the template I want to open in overlay), also what should be the structure of it. I tried creating new template from Appearance menu, which did not work. Can anybody help please?
my_custom_template:
I want to open a template on an overlay. I used following code to add a button in the sidebar (following Kier's old tutorial). But I don't understand how and where to create "my_custom_template" (the template I want to open in overlay), also what should be the structure of it. I tried creating new template from Appearance menu, which did not work. Can anybody help please?
Code:
class Abdfahim_Listener
{
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if($hookName == 'forum_list_sidebar')
{
$contents = '<div class="section">
<a href="{xen:link my_custom_template}" class="overlayTrigger">Test Button</a>
</div>'.$contents;
}
}
}
my_custom_template:
Code:
<div class="sectionMain">This is a test page to be show in overlay.<br></div>