How can we help?

If you are looking for support for our Poka theme, this is the place!

Home Forums Poka v2 support AMP iframe issue

Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  admin 2 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3315

    casino1
    Participant

    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?

    src=“https://netent-static.casinomodule.com/games/gunsnroses_mobile_html/game/gunsnroses_mobile_html.xhtml?server=https%3A%2F%2Fnetent-game.casinomodule.com%2F&lang=it&sessId=DEMO-1789429774973&gameId=gunsnroses_not_mobile&operatorId=default&staticsharedurl=https%3A%2F%2Fstatic-shared.casinomodule.com%2Fgameclient_html%2Fdevicedetection%2Fcurrent&sessId=DEMO-9724343286355”

    mce_src=“https://netent-static.casinomodule.com/games/gunsnroses_mobile_html/game/gunsnroses_mobile_html.xhtml?server=https%3A%2F%2Fnetent-game.casinomodule.com%2F&lang=it&sessId=DEMO-1789429774973&gameId=gunsnroses_not_mobile&operatorId=default&staticsharedurl=https%3A%2F%2Fstatic-shared.casinomodule.com%2Fgameclient_html%2Fdevicedetection%2Fcurrent&sessId=DEMO-9724343286355”>

    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>

    #3324

    admin
    Keymaster

    Hi!

    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?

    #3345

    casino1
    Participant

    Thanks 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’ => ”,
    ),

    #3354

    admin
    Keymaster

    Hi!

    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.

    #3364

    casino1
    Participant

    Hmm, 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? 🙂

    #3366

    admin
    Keymaster

    Yes 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 the element then it should be fine.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.