Description
- click Summary Block Item (use Universal Filter Plugin) will open Popup
- view demo – password: abc
- buy a coffee
#1. Install Code
#1.1. First you need to install WM Lightbox PluginĀ
Just add plugin code to Header/Footer Injection is enough.
#1.2. Paste this code under Universal Filter Plugin code
<!-- @tuanphan - Make Summary Block (with UF Plugin) in Popup -->
<script>
(function() {
function initSummaryPopupLinks() {
const summaryBlock = document.querySelector('.sqs-block-summary-v2');
if (!summaryBlock) return;
summaryBlock.addEventListener('click', function(e) {
const link = e.target.closest(
'.summary-thumbnail-container, .summary-title-link'
);
if (!link) return;
const href = link.getAttribute('href');
if (!href || href.startsWith('http')) return;
e.preventDefault();
e.stopPropagation();
if (window.wmPopup) {
window.wmPopup.openPopup(href);
}
});
}
document.addEventListener('wmPopup:afterInit', function() {
initSummaryPopupLinks();
});
if (window.wmPopup) {
initSummaryPopupLinks();
}
})();
</script>
