WP Manifestindependent plugin directory
manifest / builders / bricks-cct-ajax-modal

OL Bricks CCT AJAX Modal

Passes JetEngine CCT item context to Bricks AJAX popups so dynamic tokens resolve correctly.

by Output Level · github.com/outputlevel/bricks-cct-ajax-modal · website

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/outputlevel/bricks-cct-ajax-modal/archive/refs/heads/main.zip

Readme

OL Bricks CCT AJAX Modal

Enable Bricks Builder AJAX popups to work seamlessly with JetEngine Custom Content Types. When a popup is triggered, the plugin automatically fetches and injects the correct CCT item as the active JetEngine context, allowing all JetEngine tokens ({je_cct_*}) to resolve correctly inside the popup.

Overview

By default, Bricks AJAX popups pass post context to JetEngine, so tokens resolve based on the current post. This plugin extends that behavior to Custom Content Types — when you configure a popup to use a CCT context, the plugin intercepts the AJAX request, fetches the specified CCT item, and injects it, so all CCT-specific tokens resolve.

Use case: Display a modal with property details from a JetEngine Custom Content Type (e.g., real estate listings, products, testimonials) when a user clicks a trigger element, with all dynamic data populated from the CCT item.

Requirements

  • Bricks Builder v2.0 or later (for bricks/render_popup_content/start action hook)
  • JetEngine plugin (active)
  • JetEngine CCT Module must be enabled (Plugins → JetEngine → Modules → Custom Content Types = checked)

The plugin will not activate if JetEngine is missing or the CCT module is disabled.

How to Use

1. Create a Popup Template

In Bricks:

  • AddPopup → create new popup template
  • Add your popup content (heading, image, text, etc.)
  • Use JetEngine tokens for dynamic content: {je_cct_cars_name}, {je_cct_cars_price}, etc.

2. Enable AJAX Content Fetching

In the popup template:

  • Go to Template Settings (gear icon)
  • Under Popup section, enable Fetch content via AJAX
  • Save

This ensures the popup content is loaded dynamically when triggered, allowing the plugin to inject the CCT context before tokens resolve.

3. Add Interaction to Trigger Element

On any element (button, link, card, etc.) that should open the popup:

  1. Add InteractionShow action

  2. Select your Popup template as the target

  3. In Popup Context Type, select JetEngine CCT (new option)

  4. In Context ID, enter the CCT item reference in format: slug:id

    Examples:

    • cars:{je_cct_cars__ID} — use a token if inside a CCT loop (Dynamic ID)
    • cars:123 — fetch item 123 from the "cars" CCT (Static ID)

4. Test

Click the trigger element → popup opens → CCT tokens resolve with real data

Example Workflow

Scenario: Display a car details popup when clicking on a car card.

  1. Create popup template in Bricks with content:

    {je_cct_cars_image}
    {je_cct_cars_name}
    {je_cct_cars_description}
    {je_cct_cars_price}
    Model: {je_cct_cars_model}
  2. Enable AJAX: Template Settings → Popup → "Fetch content via AJAX" ✓

  3. Add interaction to car card button:

    • Action: Show → Popup: (your popup template)
    • Context Type: JetEngine CCT
    • Context ID: cars:42
  4. Result: Click card → popup loads → all CCT tokens display the car data for item 42

Troubleshooting

Popup shows but tokens are empty

  • Verify the Context ID format is correct: slug:id (e.g., cars:123)
  • Confirm the CCT slug and item ID exist in your JetEngine database
  • Check browser console for AJAX errors

Context Type dropdown shows "JetEngine CCT" but nothing happens

  • Ensure JetEngine CCT module is enabled (wp-admin → JetEngine → Modules)
  • Deactivate and reactivate the plugin
  • Clear browser cache

Plugin not activating

  • Confirm JetEngine is installed and active
  • Confirm CCT module is enabled
  • Check wp-admin → Plugins for error messages

Support

For issues or feature requests, contact support or check the plugin repository.

License

GPL-2.0-or-later

Read the full README on GitHub →