Skip Navigation

[Resolved] content template with iframe tag not saving

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Andreas 3 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2190815

Hello,
I am trying to create a content template with an <iframe> tag in it.
When I try to save the content template, a message shows up, that the template is not saved (and it is not saved).
When I remove the iframe, the template saves without any problem. The iframe works when I put it directly into a post or page.
Is there a way to allow iframes in content templates?
Thank's for your help!
Regards,
Andreas

#2191553

Hello Andreas, and thank you for contacting Toolset support.

To better assist you with this request, I'd like to know more about your use case. Please elaborate more on it so I better understand the context.
- Are you using the blocks editor or the legacy editor?
- Why would you like to use the iframe? Can you give an example?
- Is the iframe that you want to add static or dynamic? Will it need to pull something from custom fields? URL, ID, etc.?
- If you are using blocks, the embed block could be a good solution, what do you think?

If you are comfortable with coding, maybe the solution here could help https://toolset.com/forums/topic/add-an-iframe-to-elementor-using-dynamic-url/#post-1401685

Let me know more about your use case and I'll do my best to help.

#2192675
Screenshot 2021-10-11 091821.png

Hi Jamal,
thanks for your reply.
- I am using legacy editor
- I am using iframe to embed a business application (there is no other way, client doesn't want to open it in a new tab)
- iframe is dynamic, it needs to have the user login in its URL
- I created a shortcode as described here: https://toolset.com/forums/topic/add-an-iframe-to-elementor-using-dynamic-url/#post-1401685 and it is working
The workaround with the shortcode is ok, but this means more code (and more maintenance). Even if I do a test with a simple iframe (see screenshot), the content template would not save. Is there any way to tell the template editor to accept iframes?
Many thanks for your help!

#2192733

I run a test on a clean install and I was able to save iframes in a content template using the legacy editor. You can log in to my test site with this URL hidden link
Then you can check the content template for Posts here hidden link
And its results on the frontend hidden link

Maybe this is caused by a compatibility conflict, can you check if you can save the content template when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.

#2192939

Hi Jamal,
thank you very much for looking into this. I deactivated all plugins and switched to WP default theme. No change, still cannot save a content template with iframe. It seems that the issue is on my end and for the moment I cannot investigate further. I am going to implement another solution for the iframes. Thanks a lot for your help!

#2192943

My issue is resolved now. Thank you!