dicabrio Posted October 13, 2023 Share Posted October 13, 2023 I have a page with a text field that is displayed as wysiwyg editor (tinyMCE). When I add some source code like <iframe src="//www.youtube.com/embed/EdNWOlnGtrk" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>. Save the code then save the page the iframe is removed. If I do it again (add the iframe to the source code) then save the page. The iframe is there on the frontend. If I then save it again it is removed again. It looks like not being a setting of tinyMCE, but I'm not sure. Using PW 3.0.277 Link to comment Share on other sites More sharing options...
AndZyk Posted October 13, 2023 Share Posted October 13, 2023 Hello @dicabrio, I think the Iframe gets stripped out by the Purifier feature in the textarea field settings: Personally I would not disable this feature and use Hanna Code instead: https://processwire.com/modules/process-hanna-code/ Regards, Andreas 1 Link to comment Share on other sites More sharing options...
dicabrio Posted October 13, 2023 Author Share Posted October 13, 2023 It seems silly, because I do the following - Open page - Add iframe - Save page - Iframe gone on the rendered page - Add iframe (the edit page was still open) - Save the page - Iframe is visible on the rendered page - Change something on the page in the CMS (kept it open) - Save the page - iframe gone So this keeps on repeating. Hanna Code is not a solution for this problem at the moment as I have a lot of content already with iFrames. Link to comment Share on other sites More sharing options...
AndZyk Posted October 16, 2023 Share Posted October 16, 2023 If you disable the Purifier feature, the iframe should not get removed. I have tested this by manually adding an iframe in the source code view. Link to comment Share on other sites More sharing options...
Inxentas Posted October 16, 2023 Share Posted October 16, 2023 I would recommend you keep your iframe seperate from your other content. Make two fields. Check the Settings for each. For the iframe, use a Textarea without any Text Formatters. You can echo this on the frontend and get the exact HTML code you put in that field. For content with HTML markup, use a Textarea with the HTML Entity Encoder Text Formatter. I use this approach all the time for any kind of embed codes. You can treat iFrames in a similar manner. 1 Link to comment Share on other sites More sharing options...
dicabrio Posted October 17, 2023 Author Share Posted October 17, 2023 Yes tried it myself. Works by disabling the purifier. In that regard something is still going wrong. If I enable purifier the iframe is stripped only sometimes and not always. So something is happening there. @Inxentas keeping iframes separate from the content, as I do agree, is not an option at the moment. Link to comment Share on other sites More sharing options...
Inxentas Posted October 17, 2023 Share Posted October 17, 2023 Can I ask why that is not an option? Perhaps that issue is solved more easily. Link to comment Share on other sites More sharing options...
dicabrio Posted October 17, 2023 Author Share Posted October 17, 2023 Oke.. yes it is an option, but I don't want it to be an option at this point in time as it is more work. I'm migrating from an old CMS. I just copy the content from an old wysiwyg editor. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now