Populate the off-canvas drawer with widgets and connect it to a custom header trigger button.
Lesson 2.1: Constructing Off-Canvas Drawer Layout and Widgets
- Flexbox Container Layout
- WordPress Menu Breakpoint Settings
- Search Form and Social Icon Integration
Inside the popup area, insert a main full-width flexbox container. Inside it, place a horizontal row container to hold the Site Logo and Site Title side by side.
Add a Divider widget, then add a Search Form widget configured with an inline layout. Duplicate the divider to create consistent visual rhythm between sections.
Add a Heading widget (e.g., 'MENU') and drag in the WordPress Menu widget. Change the layout to Vertical and center the alignment. Crucially, set Mobile Dropdown Breakpoint to 'None'. Because the menu already lives inside a compact drawer, leaving breakpoints on default will collapse your links into an unnecessary nested hamburger button on small screens.
Add another heading (e.g., 'Follow Us') and insert Social Icons, styling their primary and secondary colors to match your brand palette.
Practical work
- Build a top branding row containing the site logo and site title.
- Insert a vertical WordPress Menu and set Mobile Dropdown Breakpoint to 'None'.
- Add an inline Search Form and Social Media Icons.
Lesson 2.2: Publishing the Drawer and Header Trigger Setup
- Publish Conditions without Triggers
- Theme Builder Header Layout
- Dynamic Tags Popup Triggers
Click Update on the Popup template. In the conditions and triggers dialog, click Next through Triggers and Advanced Rules without enabling any automatic options. Click 'Save & Close'—navigation menus must only open when requested by the user.
Open Templates > Theme Builder and edit or create a site Header. Structure a main horizontal container with child columns using custom percentage widths (such as 70% for main navigation, 20% for search, and 10% for the menu icon).
Insert an Icon widget and select an alignment or hamburger icon (e.g., 'align center'). In the Icon's Link setting, click the Dynamic Tags icon, navigate to Actions, and select 'Popup'. Click the Popup word in the field, choose Action: 'Open Popup', and type the exact name of your saved popup template ('Off the canvas 3').
Publish the Header template across 'Entire Site'. Test the live site to ensure clicking the header icon opens the off-canvas drawer smoothly.
Practical work
- Save the popup with no automated trigger conditions.
- In Theme Builder, add an Icon widget to the header layout.
- Link the Icon widget to Open Popup targeting your newly created off-canvas menu.
- Publish the header and test the toggle behavior on the live website.