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: http://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.

Comments

 
ahlam
#1 ahlam 2011-11-10 08:06

how to counecet html with php in Sourcerer
and insert data to database
tankes
 
 
Nick
#2 Nick 2011-11-10 18:48

Hi and welcome, ahlam!

Sorry for the inconvenience, if you're a student at OSTraining, could you copy and paste this into the support forum so one of our support techs can look into it for you? All you have to do is log in at www.ostraining.com and click on Support Forum in the main menu.

Please see the support FAQ for more information:
www.ostraining.com/.../

Kind regards,
Nick
 
 
Juan Rodriguez
#3 Juan Rodriguez 2013-02-25 22:35

Hi Nick, thanks for this post, is very helpfully for dummies like me.
 
 
Srinivas
#4 Srinivas 2013-03-07 10:52

Thanks Bro.Its very helpful to me.
 
 
saikanth
#5 saikanth 2013-05-04 06:33

Hi bro i have javascript slideshow code and added it to home article (default article), its working fine but not working in another articles..y

when i click on menu item the images are not loading
 

Add comment


Security code
Refresh

blog-ad

Start Online Training

Members get access to all our video training. That's 1,142 training sessions in Joomla, Drupal, WordPress and Coding.

Manage All Your Joomla Sites

adminicredible

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.

Latest Comments

The License for Our Tutorials

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:

  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.

Click here to read the full license.

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.