Okay
  Public Ticket #1072470
iframe in room sidebar
Closed

Comments

  •  2
    Yiannis started the conversation

    Hello Pasquale!

    I am trying to insert my reservations calendar widget from my channel management service. The widget code is basically an iframe. I have tried pasting the code of the widget in the "Other sidebar information" of the rooms, but when I save it, the iframe code disappears.

    Any workaround?


  •  241
    Elena replied

    Hi Yiannis,

    Unfortunately we are unable to provide support on third party plugin, it's out of scope I am sorry. For any other question related to the theme don't hesitate to ask!

    Cheers,

    Pasquale

  •  2
    Yiannis replied

    Hi Pasquale,

    Maybe I have put it wrong. My question is not about a specific plugin. I am talking about ANY html iframe in the room sidebar.

    For example, say I want to insert the following code:

    <iframe src="https://opendept.ticksy.com/"></iframe>
    

    while it does work perfectly if I put in the text section of my room, it disappears if I put in the sidebar.

    See this example please. This has in fact the same iframe in the sidebar as it has just below the hero photo. But the one the sidebar not only does it not show, it even gets deleted on the backend the minute I save the room in wordpress.

  •  241
    Elena replied

    Gotcha! Btw I can't see any iframe anywhere in the page. Well, you should consider that happens for safety reasons. As you can read here: https://github.com/WebDevStudios/CMB2/issues/368 the only way to allow the iframe tag is disabling sanitization , in other words you should open the file /inc/metabox/cmb2-functions.php and add this line of code on line 503 (just above 'options' .... ):

    'sanitization_cb' => false,

    That should do the trick but please consider that you will lose changes every time you update the theme. Hope that helps.

    Alternatively, if the iframe is the same for all room pages, you can activate the child theme, copy the file single-room.php and edit that file. Then open that with an editor and hardcode your iframe before or after the $sidebar_content (see screenshot). That way you are not going to lose changes on theme updates.

  •  2
    Yiannis replied

    Wow thanks!

    You've been a great help!

  •  241
    Elena replied

    No worries!