How can we help?
If you are looking for support for our PokaTheme, this is the place!
Home › Forums › PokaTheme support › AMP iframe issue
Tagged: amp
- This topic has 5 replies, 2 voices, and was last updated 5 years, 7 months ago by admin.
-
AuthorPosts
-
February 6, 2019 at 1:11 pm #3315casino1Participant
Hi,
Hope that someone in this forum could assist me! š
I’m trying to load slot machines via amp-iframe, the game loads and I can play, but I still get an error in AMP validator.
The error: the attribute ‘mce_src’ may not appear in tag ‘amp-iframe’.
The src is fetched with the help of ACF I use the_field() and have no problem on my non-amp pages. Not sure how or why the mce_src URL gets added.
Any ideas?PHP:
<div class=”iframe-game-wrapper”>
<amp-iframe width=”400″ height=”225″
sandbox=”allow-scripts allow-same-origin”
layout=”responsive” src=”<?php the_field(‘iframe_demo_game’); ?>”>
<amp-img placeholder layout=”fill”
src=”https://ampproject-b5f4c.firebaseapp.com/examples/images/kittens-biting.jpg”></amp-img>
</amp-iframe>
</div>February 6, 2019 at 7:10 pm #3324adminKeymasterHi!
I looked your code but I don’t understand how the mce_src is added to your markup. I believe that the value of “iframe_demo_game” has only the URL?
Also the “iframe_demo_game” what type of field is?February 10, 2019 at 1:38 pm #3345casino1ParticipantThanks for the reply.
Me neither, it’s very confusing. And google mce_src gives 0 results.
Yes, it’s only the url to the iframe.
These are the ACF conditions for the iFrame field:
array(
‘key’ => ‘field_5a82e9a68111e’,
‘label’ => ‘Iframe Demo Game’,
‘name’ => ‘iframe_demo_game’,
‘type’ => ‘textarea’,
‘instructions’ => ”,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array(
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘default_value’ => ”,
‘placeholder’ => ”,
‘maxlength’ => ”,
‘rows’ => ”,
‘new_lines’ => ”,
),February 11, 2019 at 12:48 pm #3354adminKeymasterHi!
If you output the value of this field “iframe_demo_game” to an AMP template and this field has a HTML iframe this is going to be invalid for the AMP specs.
AMP has it’s own element for iframes : https://www.ampproject.org/docs/reference/components/amp-iframe
You can either add you element as an amp-iframe and not iframe or before the output use the html sanitizers of AMP plugin so the HTML iframe to be converted to AMP iframe.February 12, 2019 at 7:52 am #3364casino1ParticipantHmm, but the html-mark up is added to the amp-template:
<amp-iframe width=ā400ā³ height=ā225ā³
sandbox=āallow-scripts allow-same-originā
layout=āresponsiveā src=ā<?php the_field(āiframe_demo_gameā); ?>ā>
<amp-img placeholder layout=āfillā
src=āhttps://ampproject-b5f4c.firebaseapp.com/examples/images/kittens-biting.jpgā></amp-img>
</amp-iframe>For the iframe_demo_game field, I only add the following: https://caocw.playngonetwork.com/casino/PlayMobile?pid=2&gid=bookofdeadmobile&lang=en_GB&practice=1
That shouldn’t be tagged as an iframe – or I’m I missing something? š
February 12, 2019 at 12:54 pm #3366adminKeymasterYes you are correct, if in the field “iframe_demo_game” there is only the URL of the iframe it is ok.
Also if tyou are already using theelement then it should be fine. -
AuthorPosts
- You must be logged in to reply to this topic.