In the version 1.0.5 and older, [Magento 2] UB Content Slider extension makes use of shortcodes embedded in blocks, pages or calls sliders via XML file. To make things a bit more user-friendly, we’ve added a new feature to the version 1.0.6 that allows you to add sliders anywhere using widget module manager.
Before we go into details about the new widget enhancement in our UB Content Slider, I will walk you through a bit on Magento 2 Widget.
Introduction to Magento 2 Widget
The Magento widgets system is a graphic interface where you can configure blocks in the front-end, with predefined set of configuration options.
As we have covered the topic introducing Magento 2 widgets part I, Magento 2 has a set of predefined widgets that you can configure and show on different pages. You no longer have to deal with the block short codes to insert the blocks.
While the “content blocks” show a powerful way and flexibility in allowing you to structure the Magento front-end layout using XML files, widgets on the other hand add a more friendly shortcut for administrators to deal with the front-end content.
Let’s see some of the possible implementations of the Magento widgets:
- Display dynamic product data;
- Show dynamic lists with the recently viewed items;
- Promotional images placed on different Magento front-end locations;
- Interactive navigation elements and action blocks;
- Dynamic flash elements that can be easily configured and embedded in content pages;
- And many more
Apart from wide variety of data, widget has a great plus point that can display anywhere on your site, from Header, Footer, Sidebar main..at Categories page, Products page, Generic page, etc., This truly provides an easy way to enrich the Magento front-end functionality.
Widget helps enhance UB Content Slider 1.0.6
With the new improvements in UB Content Slider 1.0.6, you can now configure the layout instructions to show the widget at different places in the frontend.
Let’s dive in a little bit to see how it works. Supposed that you add the widget to the Main Content area, then a new block is added to the frontend. And this block has a block class and a template similar to other blocks. The widget interface will generate a layout XML that is stored in the database (You’re probably aware of a difference here is that the regular blocks in front-end layout structure of Magento are generated by XML files).
The process of adding widgets is almost the same for all other types. Just a few simple steps away, following one of the options below:
The first option: Navigate to widget section in the admin panel of your store. Navigate to Content | Widgets | Add Widget. Then select UB Content Slider type at your choice:
The second way is to add a widget to a CMS page or static block. Navigate to Content | Elements | Pages and click on the Add New Page button. In the Content tab, click on the highlighted button in the WYISIWYG editor, as shown in the following screenshort. You can follow similar steps to add a widget to static block.
Once you create a new slider using widget as mentioned above, a variety of configuration options are in place for you to define slider that fits your store most.
So as you can see, the widget in Magento 2 provides a better way to set up and manage sliders, especially for non-technical back-end administrators of the site. With UB Content Slider 1.0.6, you can simply add content sliders by inserting the widget into the selected static page of your store.
Hope this post has helped you have an overview on the Magento 2 widgets as well as how it works in our UB Content Slider. If you have any question or feature request, please head to our dedicated support forum, or you can leave your feedback in the comment below.