Create a Widget
Overview:
Widgets are an effective tool for updating your website without having to dive into the template code. They are also useful for inserting and managing content, javascript, and images throughout your site.
To create a widget follow the steps below:
Create Widget
-
From the dashboard click Content.
-
Then click My Widgets.
The Widgets page displays.
-
Click New Item.
The New Widget form displays.
-
Enter the New Widget details:
- Title: This field is only used to identify your Widget within the Admin Tool.
- Publish: Use the checkbox to activate the Widget.
-
Click Save.
Add Widget to Template
-
From the dashboard click Themes.
-
Then click Installed Themes.
-
Navigate to your site's Twig templates. For example, the homepage index.html template.
-
Using the Template Editor tool, add the following code to include your Widget within the template.
Replace slug_name with the Slug name that you created, eg. homepage-main-promo
-
Click Save.
-
Click Deploy.
Please sign in to leave a comment.
There are 0 Comments