Requirements
-
Cxense Content widget created for mobile page
Instructions
Idea here is to have an HTML page which renders a Content widget (only a widget, nothing else), and to call it from an amp-iframe.
Here's an example of an HTML page. A widget ID and a context (URL) should be passed as query parameters.
|
On AMP pages, add an amp-iframe object referring to the HTML page:
|
You can see a live demo here: https://onb-de1.cxense.com/public/samples/content/amp-sample.html
Tips & Warnings
-
There are some important requirements you must follow to make amp-iframe work. Most notably:
-
They must be either 600px away from the top or not within the first 75% of the viewport when scrolled to the top – whichever is smaller.
-
They must only request resources via HTTPS or from a data-URI or via the srcdoc attribute.
-
-
The 'overflow' element in the given sample above is just an example. You should modify as necessary to fit the page design.
Related
-
amp-iframe object:
https://www.ampproject.org/docs/reference/extended/amp-iframe.html