Plugin to show dynamic popups in the frontend. Inspired by an OctoberTrick.
Note: currently only supports Bootstrap 5 modals.
Add the [ajaxPopup]
to your page.
Add the data-popup
attribute to the element that triggers the Ajax request:
<button
data-request="onYourAjaxHandler"
data-popup="yourPopupIdentifier">
Show popup
</button>
In your ajax handler reference the popup identifier:
function onYourAjaxHandler()
{
return [
'yourPopupIdentifier' => $this->renderPartial('@your-partial'),
];
}