Earl
Well-known member
If you are familiar with the widget system in XenForo, as you may be aware, this special kind 'HTML' type widget, allows you to add raw HTML code to your site.
I can create other type widgets when installing the addon, in setup.php
but How do you create this HTML type widget using installSteps in setup.php file?
This code will be enough to create the addon, but it gives an error when page loading because I didn't set a template.
How do you create the template and bind to it?
I can create other type widgets when installing the addon, in setup.php
but How do you create this HTML type widget using installSteps in setup.php file?
PHP:
public function installStep1()
{
$this->createWidget('earl_my_addon_widget', 'html', [
'positions' => ['earl_wpos_bottom_navbar' => 10],
'options' => ['advanced_mode' => true,
'template_title' => 'my widget title',
]
]);
}
How do you create the template and bind to it?