You can embed iframes into landing pages in ActiveDEMAND.
- In the builder drop a text block onto your asset
- Click into the text block (or advanced edit) to bring up the text editor
- Click the 'source code' button on the editor
- Paste your iframe code into the editor
You need to be aware of a few things to ensure you get the results you are looking for. By default, the editor will force the iframe to be embedded such that it blocks all popups, javascript to be executed in the iframe. This is done by ensuring the sandbox attribute is set on the iframe.
If you want to allow specific items to be 'allowed' in your iframe, you will need to set the sandbox values.
sandbox Attribute Values
Value | Description |
---|---|
(no value) | Applies all restrictions |
allow-forms | Allows form submission |
allow-modals | Allows to open modal windows |
allow-orientation-lock | Allows to lock the screen orientation |
allow-pointer-lock | Allows to use the Pointer Lock API |
allow-popups | Allows popups |
allow-popups-to-escape-sandbox | Allows popups to open new windows without inheriting the sandboxing |
allow-presentation | Allows to start a presentation session |
allow-same-origin | Allows the iframe content to be treated as being from the same origin |
allow-scripts | Allows to run scripts |
allow-top-navigation | Allows the iframe content to navigate its top-level browsing context |
allow-top-navigation-by-user-activation | Allows the iframe content to navigate its top-level browsing context, but only if initiated by user |
Forcing it with Jquery
In your landing page script you can try to change the settings at runtime.
var iframe = document.getElementById('yourId');
$(iframe).prop('sandbox',"allow-scripts allow-same-origin allow-scripts allow-popups allow-forms");
$('iframe').attr('src', $('iframe').attr('src'));
Comments
Please sign in to leave a comment.