Elxis CMS Forum

Support => Administration => Topic started by: kyomar on July 31, 2019, 08:43:32

Title: Edit article - jodit iframe?
Post by: kyomar on July 31, 2019, 08:43:32
Hi all, I have just upgraded elxis 4.6 to 5.0. Everything went smooth, congrats to the new version. I have one weird thing going on when I edit an article. I have an <Iframe code in the main text and suddenly I get this code in front of it: "<jodit data-jodit-temp="1" draggable="true" data-jodit_iframe_wrapper="1" style="display: block; width: 0px; height: 0px;" contenteditable="false"><iframe..".
I have tried to delete it but after save it always comes back. In another article I have a <br> and when I delete it and save the article it always comes back. What is going on?
Thanks for your time!
Title: Re: Edit article - jodit..?
Post by: datahell on July 31, 2019, 14:59:00
I really don't know. Maybe the content in editor is bad formatted html which breaks the editor. This happens in 1 specific article or on any article? What about when you go to add a new article?
Title: Re: Edit article - jodit..?
Post by: kyomar on August 01, 2019, 12:24:06
Thanks datahell for your prompt response. I have the same <iframe> code in another article and there it doesn't get changed but it has added a <br> at the end and after deleting it and saving the article the <br> reappears again. I have also tried to open a new article and copied the code below with the same result, after saving the weird code was added (see 2nd example).

Original code:
Code: [Select]
<div style="display: inline-block; vertical-align: top; width: 40%; min-width: 360px; margin-bottom: 10px;"><iframe scrolling="no" src="/blabla/blabla/availability_tpl.php?framed=1" style="width: 100%; height: 190px;" title="Room Availability Check" frameborder="0">Room Availability Check</iframe></div>
Automatically changed code:
Code: [Select]
<div style="display: inline-block; vertical-align: top; width: 40%; min-width: 360px; margin-bottom: 10px;"><jodit data-jodit-temp="1" draggable="true" data-jodit_iframe_wrapper="1" style="display: block; width: 0px; height: 0px;" contenteditable="false"><iframe scrolling="no" src="/blabla/blabla/availability_tpl.php?framed=1" style="width: 100%; height: 190px;" title="Room Availability Check" frameborder="0">Room Availability Check</iframe></jodit></div>
Title: Re: Edit article - jodit..?
Post by: datahell on August 01, 2019, 20:45:04
I advice you not to use iframes...
Title: Re: Edit article - jodit..?
Post by: kyomar on August 07, 2019, 05:18:12
I researched a bit about the problem with iframe and jodit and found this site: https://xdsoft.net/jodit/ (https://xdsoft.net/jodit/). If you enter there <iframe></iframe> it will add the same code as in my case:
Quote
<jodit data-jodit-temp="1" draggable="true" data-jodit_iframe_wrapper="1" style="display: block; width: 300px; height: 150px;" contenteditable="false"><iframe></iframe></jodit>
The result is that the iframe disappears on my site, so I cannot upgrade my live site to elxis 5.0 as I need the iframe. There must be a setting somewhere in jodit but that is beyond my capability.
Title: Re: Edit article - jodit..?
Post by: datahell on August 07, 2019, 21:26:33
So Jodit doesn't like iframes (I also dont like them). I repeat: I advise you not to use iframes, it is an evil tag :o

BTW: I have no problem using iframes in Jodit. So maybe the problem might be the content you add to it. For instance iframes may contain javascript which can cause problems to the editor. Also note that the usage of iframes is extremely risky when the source is a remote site. DONT USE IFRAMES IN THIS CASE! FYI Elxis has a related security configuration for frames called "X-Frame-Options".

Here is an example: You have a form shown in a page. In that page you also have an iframe with source to my site. I put some javascript there that stores the data your customers put in the form like credit card details. I can steal this information easily without anyone noticing it.
Title: Re: Edit article - jodit iframe?
Post by: kyomar on August 08, 2019, 09:04:41
Thanks datahell, I fully agree what you are saying about the iframe tag but I still need it and so do many others and it is fully W3C compliant. The source is not remote, it's from my own site (booking inquiry form from a booking software hosted on my site/space). Anyhow as long as Jodit isn't able to handle iframe correctly i cannot updgrade to elxis 5.0 (as many others who need iframe) which is a shame as I would love to upgrade to elxis5. The iframe is correctly coded and has worked flawlessly for many years. I have tried to copy the whole code  (booking form) into the article but that is not as convenient as within an iframe.
I found out that in the settings one could disable iframe according to there own website (https://xdsoft.net/jodit/play.html (https://xdsoft.net/jodit/play.html)). Jodit wants us to use there <Jodit> tag like a <div> tag. I don't like if an editor wants to enter it's own code and I cannot control it. It should just suggest it but in the end I should be able to decide. Funny in one article I have the exact same iframe and there the code isn't replaced, it just adds a <br> tag for I don't know what reasons.
Thank you for your help and feedback datehell - I really appreciate it.