Add bellow code into /platform/themes/your-theme/functions/functions.php
register_sidebar([
'id' => 'sidebar_name',
'name' => __('Sidebar Name'),
'description' => __('This the description for widget area'),
]);
{!! dynamic_sidebar('sidebar_name') !!}
{warning} Dev tools are removed in the download package, you need to delete folder
/vendor
and run commandcomposer install
to reinstall it, then you can use dev commands.
1/ To create a widget, using below command:
php artisan cms:widget:create <widget name>
This widget will be created in /platform/themes/<current active theme>/widgets/<widget name>
.
Then go to /admin/widgets
, you will see your widget.
{note} You can follow other widgets in default themes: Ripple and NewsTV to create widget.
2/ To remove a widget, using below command:
php artisan cms:widget:remove <widget name>
This widget will be removed.
A widget will have 3 files: This main class to init widget.
/platform/themes/ripple/widgets/tags/tags.php
/platform/themes/ripple/widgets/tags/templates/frontend.php
/platform/themes/ripple/widgets/tags/templates/backend.php