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.
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.
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 Filtering
Go 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 Solutions
Over 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.
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: