XF 2.2 Insert a widget to the forum list sidebar while the addon installation

michael.s

Member
Is there a clean way to automatically insert a widget during the addon installation, or should I do this via manual SQL queries?
 
Yes, in the setup file:

PHP:
$this->createWidget(
    'some_widget_key',
    'some_definition_id',
    [
        'positions' => ['forum_list_sidebar' => 40], // position ID => display order
        'options' => [], // widget options
    ],
    'Some title', // optional
);
 
Top Bottom