I’m trying to create a custom module that has a button item contain a logo, modal pop-up description, logo name field. I can get the modal pop-up to work when there is no “item” but as soon as I create the item to group the fields, it breaks.
The reason I’m putting it in a grouped item is because I need to put multiple logos with modals on a page. (see attached for what I’m trying to take their static images and place modals over https://www.mbassett.com/our-clients)
This is the code before putting it in grouped items (which works):
<!-- The button -->
<a href=“#{{ widget.modal_button|replace(‘&’,‘and’)|replace(’ ‘,’-‘)|replace(’(‘,’-‘)|replace(’)‘,’-‘)|replace(’?‘,’‘)|replace(’”‘,’‘)|replace("’“,”“)|replace(”.“,”“)|replace(”:“,”“)|replace(”,“,”“) }}” class=“open-popup-link”>
<img src=“{{ widget.logo.src }}” alt=“{{ widget.logo.alt }}”>
</a>
<!-- the modal popup is hidden until the button is clicked -->
<div id=“{{ widget.modal_button|replace(‘&’,‘and’)|replace(’ ‘,’-‘)|replace(’(‘,’-‘)|replace(’)‘,’-‘)|replace(’?‘,’‘)|replace(’”‘,’‘)|replace("’“,”“)|replace(”.“,”“)|replace(”:“,”“)|replace(”,“,”“) }}” class=“white-popup mfp-hide”>
{{ widget.logo_name }}
{{ widget.modal_popup }}
</div>
<!-- Copy and paste your css file between the quotations in the href below -->
<link rel=“stylesheet” href=“CSS_File_URL_Goes_Here”>
<style>
.white-popup {
position: relative;
background: #FFF;
padding: 20px;
width: auto;
max-width: 500px;
margin: 20px auto;
}
</style>
<!-- Copy and paste your js file between the quotations in the src below -->
<script src=“{{ get_asset_url(‘/Martyn_Bassett_November2018 Theme/Coded Files/Logo PopUp Modal.js’) }}”></script>
<script> $(document).ready(function() {
$(‘.open-popup-link’).magnificPopup({
type:‘inline’,
midClick: true
});
});
</script>
This is the code I’m trying to get to work for grouped item “logo_item”:
<!-- The button -->
<a href=“#{{ widget.item.modal_button|replace(‘&’,‘and’)|replace(’ ‘,’-‘)|replace(’(‘,’-‘)|replace(’)‘,’-‘)|replace(’?‘,’‘)|replace(’”‘,’‘)|replace("’“,”“)|replace(”.“,”“)|replace(”:“,”“)|replace(”,“,”“) }}” class=“open-popup-link”>
<img src=“{{ widget.item.logo.src }}” alt=“{{ widget.item.logo.alt }}”>
</a>
<!-- the modal popup is hidden until the button is clicked -->
<div id=“{{ widget.item.modal_button|replace(‘&’,‘and’)|replace(’ ‘,’-‘)|replace(’(‘,’-‘)|replace(’)‘,’-‘)|replace(’?‘,’‘)|replace(’”‘,’‘)|replace("’“,”“)|replace(”.“,”“)|replace(”:“,”“)|replace(”,“,”“) }}” class=“white-popup mfp-hide”>
{{ item.logo_name }}
{{ item.modal_popup }}
</div>
<!-- Copy and paste your css file between the quotations in the href below -->
<link rel=“stylesheet” href=“CSS_File_URL_Goes_Here”>
<style>
.white-popup {
position: relative;
background: #FFF;
padding: 20px;
width: auto;
max-width: 500px;
margin: 20px auto;
}
</style>
<!-- Copy and paste your js file between the quotations in the src below -->
<script src=“{{ get_asset_url(‘/Martyn_Bassett_November2018 Theme/Coded Files/Logo PopUp Modal.js’) }}”></script>
<script> $(document).ready(function() {
$(‘.open-popup-link’).magnificPopup({
type:‘inline’,
midClick: true
});
});
</script>
Can someone please tell me what I’m doing wrong?

