Start a FREE 7 day trial! Get training videos and books, plus expert support:  

Joomla Tutorials and Blog Posts

Use Javascript or PHP in a Joomla Article

Normally in a Joomla article, code such as Javascript or PHP will not work. This is for good security reasons. People could do a lot of harm if they were free to use these inside your articles. However, many advanced users need to use such code. This tutorial will show you how to do it:

Download the Sourcerer Plugin

tutuploadsmedia_1276017131750.png

Go to the Joomla Extensions Directory and find Sourcerer: https://extensions.joomla.org/extensions/edition/custom-code-in-content/5051
Click on the "Download" link and you'll be taken to the developer's website where you can download Sourcerer.

Upload and Install Sourcerer

tutuploadsmedia_1276017275295.png

In the Administrator area of your Joomla site, click "Extensions" then "Install/Uninstall". Click "Browse" to find the Sourcerer plugin and think click "Upload File & Install"

Create a New Article

tutuploadsmedia_1276017488671.png

Click "Content" then "Article Manager" and then "New"

Scroll to the Bottom of the Article

tutuploadsmedia_1276017571725.png

Click on the new "Insert Code" at the bottom of the article.

Pop-Up Box

tutuploadsmedia_1276017761389.png

You can write your code directly into this box. Just make sure that code has the normal opening and closing tags. When you're done, click "Insert" in the top-right corner.

Save the Article

tutuploadsmedia_1276017876784.png

Don't make any changes to the code you've created. Save the article with the editor turned on and all the code in between the opening { source } and closing { /source } tags.

 

Start a FREE 7 day trial! Get training videos and books, plus expert support: