Creates or debugs Bricks popup templates including placement conditions, opening triggers, frequency limits, and close behavior. Covers template settings, interactions system, and display condition logic.
Ships in bricks. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A popup in Bricks is a template with _bricks_template_type = popup. Create the popup template first, then wire triggers, display conditions, frequency limits, and any JS control around that template.
popup: stored as _bricks_template_type post_meta on a Bricks template post (Templates::get_template_type() in includes/templates.php). Canonical string: 'popup'._bricks_page_content_2 meta (same as any Bricks template)._bricks_template_settings, not as individual post meta rows. Helpers::get_template_settings() and Helpers::set_template_settings() read and write this object.Key template setting keys:
| Setting key | Purpose |
|---|---|
popupCloseOn | backdrop, esc, or none. If no value is saved, the frontend uses the default backdrop-esc behavior (includes/popups.php) |
popupBodyScroll | Presence flag: true enables body scroll while open; unset/false removes the flag (includes/popups.php:124-129) |
popupAjax | Presence flag: true AJAX-loads content per trigger instead of inline; unset/false removes the flag (includes/popups.php:206-211) |
popupLimitWindow | Per-page-load limit count (includes/popups.php:556-566) |
popupLimitSessionStorage | Per-session limit count |
popupLimitLocalStorage | Cross-session limit count |
popupLimitTimeStorage | Hours until popup can show again |
popupIsInfoBox | Boolean: popup is used as a map info-box (includes/popups.php:173-178) |
These keys sit next to generic template settings in the same settings object. Through MCP, popupCloseOn must be a single scalar value: backdrop, esc, or none; pass null, false, or an empty string to unset optional popup settings.
Triggers (when): what action on the page fires the popup.
trigger: "click", action: "show", target: "popup", and templateId set to the popup template id.includes/interactions.php:87-129.Display conditions (where): whether the popup is eligible to show on the current page at all.
any, frontpage, postType, archiveType, search, error, terms, ids, and hook.Database::$active_templates['popup'], so its DOM is not rendered on normal page loads.bricks-templates-conditions skill).The "no conditions = no fire" trap:
A popup with no display conditions set will not fire automatically because it is not rendered into the page in the normal popup collection. bricksOpenPopup(id) only works after matching conditions or another rendering path places the popup DOM on the page. A popup with trigger: contentLoaded still needs matching display conditions.
The correct flow for a page-load popup on the home page:
trigger: "contentLoaded", action: "show", target: "popup", and templateId set to the popup template id.{ main: "frontpage" } for the front page or { main: "any" } for site-wide eligibility.From includes/interactions.php and includes/settings/settings-template.php. Popup openers use normal interactions with action: "show" and target: "popup". Popup templates can also use template-level lifecycle triggers, showPopup and hidePopup, in template_interactions.
| Trigger | Fires when |
|---|---|
contentLoaded | Page DOM-ready |
scroll | Page scrolled (configurable % or px) |
click | Element clicked |
mouseenter / mouseleave / mouseover / focus / blur | Pointer / focus events |
mouseleaveWindow | Exit-intent (pointer leaves top of window) |
enterView / leaveView | Element enters/leaves viewport |
animationEnd | A CSS animation finished on the element |
formSubmit / formSuccess / formError | Form events |
ajaxStart / ajaxEnd | Query AJAX loader lifecycle |
filterSubmitStart / filterSubmitEnd | Query filter submit lifecycle |
showPopup / hidePopup | Popup-template lifecycle triggers only. They are stored in popup template settings as template_interactions, not on normal element interactions. |
filterOptionEmpty / filterOptionNotEmpty | Query-filter options (conditional) |
wooAddedToCart / wooAddingToCart / wooRemovedFromCart / wooUpdateCart / wooCouponApplied / wooCouponRemoved | WooCommerce events (conditional) |
Popup opening is an interaction action:
action: "show", target: "popup", and templateId set to the popup template id.toggleOffCanvas is for off-canvas elements, not the normal popup template target.bricksOpenPopup(POPUP_ID) is still valid, but the native interaction shape is the first choice when authoring Bricks data.Bricks exposes 4 frequency counters per popup (stored in browser state by popup id):
| Layer | Key | Lifetime | Use for |
|---|---|---|---|
| Page-load | window.brx_popup_{id}_total | Single page navigation | "Show once per page" |
| Session | sessionStorage.brx_popup_{id}_total | Browser tab closed | "Show once per session" |
| Local | localStorage.brx_popup_{id}_total | Cleared only by user | "Show once forever" |
| Time | localStorage.brx_popup_{id}_lastShown | Hours configured | "Show once every N hours" |
Configured on the popup template's settings (popupLimit* keys). popupLimitTimeStorage is the hours-TTL for the time layer.
The limit check runs in bricksPopupCheckLimit() (src/assets/js/frontend.js:14136) before bricksOpenPopup() proceeds.
Testing frequency limits: clear only the tested popup’s brx_popup_{id}_* storage keys before retesting.
Defined in src/assets/js/frontend.js: bricksOpenPopup() (:13575) and bricksClosePopup() (:14069).
bricksOpenPopup( popupIdOrDomNode, timeout = 0, additionalParam = {} );
bricksClosePopup( popupIdOrDomNode );
timeout: milliseconds before the open actually fires. Bricks adds animation-duration automatically; use this for deliberate extra delay.additionalParam: only used when popupAjax is on. Use popupContextId and popupContextType to set the render context explicitly, or let Bricks derive loop context from loopId.Common patterns:
// Open via id
bricksOpenPopup( 123 );
// Open with 2-second delay
bricksOpenPopup( 123, 2000 );
// Open AJAX popup with post context (e.g. product quick-view)
bricksOpenPopup( 123, 0, { popupContextId: currentProductId, popupContextType: 'post' } );
// Close
bricksClosePopup( 123 );
Use the native interaction or bricksOpenPopup() to open a popup.
popupAjax mode renders popup content server-side per-trigger. That means dynamic tags inside the popup resolve against the AJAX request's context, not the page that triggered it.
{post_title} use the current page context or the loop context Bricks can derive from loopId.additionalParam: bricksOpenPopup(id, 0, { popupContextId: 42, popupContextType: "post" }). Supported context types are post, term, and user (popupContextType).A popup can have display conditions like any template. Rules for how they evaluate:
bricksOpenPopup(id) returns without opening because there is no popup node to target.For "usable everywhere via JS": set conditions to { main: "any" }.
Popup doesn't show on expected trigger?
a. Open DevTools -> Application -> Local Storage + Session Storage -> look for brx_popup_{id}_*. Clear them. Retry.
b. Check the popup template's display conditions: does the current page match?
c. Check the page DOM for .brx-popup[data-popup-id="POPUP_ID"]. If it is absent, conditions do not match or the popup was not rendered by another path.
Popup opens but content is stale / wrong post?
a. AJAX mode + missing additionalParam.popupContextId. Pass the context with popupContextType when needed.
Popup opens twice?
a. Two interactions both calling bricksOpenPopup(id). Or a popup with contentLoaded trigger and a button click -> open popup on the same page: both fire.
bricksOpenPopup(id) silently does nothing?
a. The popup template is not rendered on this page (no matching conditions). Grep .brx-popup[data-popup-id="{id}"] in the page source: if absent, conditions don't match.
b. Frequency limit already hit. Clear the tested popup’s storage keys.
c. Popup id doesn't exist (typo / deleted template).
Exit-intent popup fires on mobile?
a. It shouldn't: mouseleaveWindow only fires on desktop. If it does, a different trigger is wired in too.
Popup rendered but not visible?
a. CSS specificity issue: something else has a higher z-index. Bricks popups use z-index: 10000 by default, unless popupZindex or CSS overrides it; check for other overlays.
b. Animation never completes: element has display: none stuck. Check DevTools -> Elements for the popup's .brx-popup root.
list-popups: enumerate every popup template on the site with display-condition summary.get-popup-config: full config of one popup (content tree + settings).update-popup-settings: change popup-specific template settings, including frequency, AJAX loading, close behavior, and template-level template_interactions. Use set-template-conditions for display conditions and update-element-interactions for opener elements._bricks_template_type = popup.contentLoaded = instant. It's DOM-ready, which on slow networks can be seconds after the user perceives the page as loaded.What SKILL.md sets; muted values are Claude Code's defaults
46 skills in this plugin
/bricks-agent-repositoryHandle complex existing-site Bricks edits through advertised repository/workspace workflows when focused abilities cannot express the change./bricks-ai-tabDiagnose Bricks AI connection setup, ability toggles, dispatcher availability and disabled actions. Use for connection/availability problems./bricks-audit-design-systemAudit Bricks classes, variables, palettes and components, or carry out requested cleanup. Report-only audits do not authorize fixes./bricks-breakpointsRead or change Bricks responsive breakpoint definitions. Use for breakpoint configuration, not ordinary element styling at an existing breakpoint./bricks-browser-verifyInspect a Bricks page in a browser, compare it with a design or baseline, or verify a completed change. Inspection requests remain read-only./bricks-child-theme-patternsSet up or debug a Bricks child theme, including asset loading and extension registration. Use for theme-level PHP/files, not ordinary Builder edits./bricks:bricks-popupsfrom bricks
npx claudepluginhub codeerhq/bricks-skills --plugin bricksOther plugins' skills for the same job