
![]() Code can be dangerous. The right code in the right place brings your site to life, but there are many places where it can be a huge security risk. Inside your content, code can be dangerous. If you allow people to use PHP, Javascript, iframes or other code inside content, you greatly increase the chances of a malicious script being used. To minimize this risk, by default Joomla restricts the code you can use in content. Drupal does exactly the same thing and you can read the solution for Drupal by clicking here. The downside to this is that some common code isn't allowed. For example, YouTube and Google Maps embed code aren't allowed. This tutorial will show you allow such code on your site by stopping Joomla from stripping it out. Example![]() Here's a Google Maps example. Normally you'd click Toggle Editor and past the code directly into the editor. However, if you now click Save & Close, your article will look like the image below. The map won't show. ![]() That's the problem. Here's the solution. Step 1: Turn off FilteringGo to Site > Global Configuration > Text Filters. ![]() If you want to disable code filtering for yourself, set Super Users to No Filtering. You can also disable filtering for other levels, but do so carefully, particularly for Registered users who you might not trust as much.
![]()
Click Save & Close. Step 2: Turn off the TinyMCE Editor![]() Go to Site > Global Configuration. ![]() Set Default Editor to Editor - None. Click Save & Close. ![]() Now you can go to your article and safely paste in the code. It will appear as in the image below. ![]() Longer Term SolutionsOver the long term this is a cumbersome solution partly because Step 2 requires you to constantly go back and forth, turning the editor on and off. It also makes it harder to edit the article again in the future. One solution is to use a better editor than TinyMCE which is the Joomla default. JCE from http://www.joomlacontenteditor.net is free and substantially better. ![]() Also recommended are two extensions from http://www.nonumber.nl. Sourcerer allows you to place any code inside your content with the editor still turned on. It's avaiable from http://www.nonumber.nl/extensions/sourcerer. ![]() Snippets allows you to enter the code once and then create a reusable text snippet that can be easily placed inside any article. We use it on this site to safely embed the code for our ticket sales. Snippets can be downloaded from http://www.nonumber.nl/extensions/snippets. ![]() ![]() |

With Admincredible you can update and manage all your Joomla sites. If you have 5 or 500 sites, Admincredible will make your life easier! Visit Admincredible.com.
All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:
Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.
Copyright 2013 Open Source Training, LLC. All rights reserved.
Comments
View large map
Is the above suggestions for joomla 1.7?
thx
Yes, it's for Joomla 1.7. What version are you using?
Kind regards,
Nick
joomla 1.7.3, I tried with TinyMCE Editor and with Jce editor.
Made all the setting required like remove "iframe" is forbidden from the list. or make sure I am white list or filtering off ect but still stripping the code. Also tried to Set Default Editor to Editor - None, but no luck
I really appreciate your propmt reply,
Regards
safe77
Go to Article Manager >> options >> filtering >> turn off filtering for super users.
Kind regards,
Nick
I have done that too!
I tried with TinyMCE Editor :
- In Article Manager option >> Text Filters >> Super Users : Not Filtering
- In Extentions >> Plug-in Manager >> Editor TinyMce >> Basic options Prohibited Elements : cancelled iframe from the list.
Still not working.
After I tried/switched to Jce editor :
In the JCE Control Panel, >> Editor Plugin Parameters >> Default ( in my case) >> Media Support : Allow IFrames is set yes.
Am I missing something?
Kind regards,
Nick
I did try also editor set to "no editor" and filtering disabled in article manager options but still not keeping iframe.
I just want to add a google map in to contact form, not other iframe.
Thx
We would love to get into a discussion with you on this. If you are a student at OSTraining.com, please log into the support forum (www.ostraining.com/.../) and post the question in there, so that one of our support techs can look into it for you. If you’re not a student, I hope you’ll consider becoming one, so that we can give you the attention you deserve. You can find out more about our online class at www.ostraining.com/online
Kind regards,
Nick
Thanks,
Pete
Kind regards,
Nick
We've now updated it :)
Kind regards,
Nick
If you are a student at OSTraining.com, please log into the support forum (www.ostraining.com/.../) and post the question in there, so that one of our support techs can look into it for you.
Kind regards,
Nick
Thanks, Doug