Circular Iframe
Content items designed to live inside the digital circular.
Here we include the script to display some iframe content.
<div id="webstop-circular"
data-retailer-id="3296"
data-api-host="https://rails.example.com"
data-cdn-host="https://cdn.example.com"
data-web-host="https://lasso.example.com"
>
</div>
<script src="https://example.com/circulars/circular-iframe-parent.min.js" crossorigin="anonymous"></script>
<div id="webstop-circular"
data-retailer-id="3296"
data-api-host="https://rails.example.com"
data-cdn-host="https://cdn.example.com"
data-web-host="https://lasso.example.com"
>
</div>
<script src="https://example.com/circulars/circular-iframe-parent.min.js" crossorigin="anonymous"></script>
<div id="webstop-circular"></div>
<script src="https://example.com/circulars/retailer-3296-circular-iframe-parent.min.js" crossorigin="anonymous"></script>
https://s3.grocerywebsite.com/customizations_v3/retailer_767/javascripts/
The script does the following:
- Creates a Circular iframe containing the circular inside the
#webstop-circular
div. - Creates a Modal with modal iframe within the body
- Listens for a postMessage indicating the modal should be triggered and what URL to load into the iframe.
- Listens for a postMessage indicating the height of the circular has changed, and updates the circular iframe height.
Notes
How will this deploy? Via Core-Customizations? Maybe the retailer file should be in core-customizations, but core-customizations doesn’t have the JS goodies for compiling and minifying JS files.