M michael.s Member Sep 1, 2023 #1 Is there a clean way to automatically insert a widget during the addon installation, or should I do this via manual SQL queries?
Is there a clean way to automatically insert a widget during the addon installation, or should I do this via manual SQL queries?
Jeremy P XenForo developer Staff member Sep 1, 2023 #2 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 );
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 );