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 add a JavaScript or PHP code to a Joomla article.
Step #1. Download the Sourcerer Plugin
- Go to the Joomla Extensions Directory and find Sourcerer.
- Click on the "Download" link and you'll be taken to the developer's website where you can download Sourcerer.
Step #2. Upload and Install Sourcerer
- In the Administrator area of your Joomla site, click Extensions > Manage. You will be taken to the Extensions: Install administrative page:
- Click Upload Package File tab.
- Click Or browse for file green button and find the Sourcerer plugin installation file on your hard drive.
- Click twice on the plugin package file name to start its installation.
- Go to Extensions > Plugins. and make sure the following plugins are enabled:
- Button - Regular Labs - Sourcerer
- System - Regular Labs - Sourcerer
Step #3. Add JavaScript and PHP codes to a Joomla Article
- Click Content > Articles > Add New Article.
- Click on the new Code icon at the TinyMCE editor toolbar.
- You will see Insert Code popup.
- Write your code directly into the box. Make sure that code has the normal opening and closing tags.
- When you're done, click Insert in the top-left corner.
- Click Save or Save & Close.
- Now check this article at your site frontend. You should see your JavaScript and PHP code snippets at work.
What's Next?
What's Next?
Save $1,000's when you sign up for Joomlashack's Everything Club.
You will get your hands on our extensive range of over 20 extensions, plus legendary support!