Creating a Widget
The process of creating a widget is nearly the same for each widget type. You can follow the first part of the instructions, and then complete the last part for the specific type of widget you want.
Widgets
Step 1: Choose the type
-
On the Admin sidebar, go to Content > Elements > Widgets.
-
Click Add Widget.
-
In the Settings section:
-
Set Type to the widget type that you want to create.
-
Verify that Design Theme is set to the current theme.
Widget settings
-
-
Click Continue.
Step 2: Specify storefront properties and layout
-
In the Storefront Properties section:
-
For Widget Title, enter a descriptive title for the widget.
This title is visible only from the Admin.
-
For Assign to Store Views, select the store views where the widget will be visible.
You can select a specific store view, or
All Store Views
. To select multiple views, hold down the Ctrl key (PC) or the Command key (Mac) and click each option. -
(Optional) For Sort Order, enter a number to determine the order this item appears with others in the same part of the page. (
0
= first,1
= second,3
= third, and so on.)
Storefront properties
-
-
In the Layout Updates section, click Add Layout Update.
-
Set Display On to the type of page where it is to appear.
-
In the Container list, choose the area of the page layout where it is to be placed.
Layout updates
-
If the widget is a link, set Template to one of the following:
Block Template Formats the content so it can be placed as standalone unit on the page. Inline Template Formats the content so it can be placed inside other content. For example, a link that goes inside a paragraph of text.
Step 3: Complete the widget options
The options for each widget type vary slightly, but the process is essentially the same. The following example displays the product list for a specific category, with pagination controls.
-
In the left panel, choose Widget Options.
-
Click Select Block.
-
Enter a Title to appear above the list, such as
Featured Products
. -
For pagination controls, set Display Page Control to
Yes
and do the following:-
Enter the Number of Products per Page.
-
Enter the total Number of Products to Display.
-
Set Condition to the category of products to be featured.
The process is the same as setting a condition for a price rule.
Widget options
-
Step 4: Save and check the result
-
When complete, click Save.
-
When prompted, follow the instructions at the top of the workspace to update the cache, as needed.
-
Return to your storefront to verify that the widget is working correctly.
To move it to a different location, you can reopen the widget and try a different page or block reference.