| Joomla

Add Code to Articles and Modules in Joomla

It's one thing to carve the date in stone when you're beautifying a town in rural Indiana, but it's another thing if the footer of your Joomla website still says 2015. Well this is a problem we can easily solve. 

In this video, I want to talk to you about a fantastic plugin from Regular Labs called Sourcerer.  Sourcerer allows you to add code to Articles and Modules in Joomla including: PHP, CSS, and HTML. 

I've used this consistently for the last 10 years, and it is a terrific plugin, so let's go!

"Hi, I'm Rod Martin, and this is OSTips from OSTraining.

There's a free version and a pro version of Sourcerer. The pro version allows you to do just a few more things like:

  1. The ability to include other files and select your include method.
  2. Some advanced security settings that are really worth it.

Add code to articles and modules in Joomla

I'm just going to show you how to quickly and simply fix the footer of your Joomla website, so the FREE version will be fine. 

For years, all we did on January 1st of every year (if we remembered), was open up our copyright module and change the date.  Well how silly is that when Sourcerer can update the date for you automatically every year?  You'll never need to touch the copyright date again. It's quite simple in PHP to do that.

  • download Sourcerer
  • install Sourcerer to your Joomla site
  • go to Extensions >> Modules
  • click on the module containing your copyright information
  • scroll to bottom of text window
  • click <> Code button

Add code to articles and modules in Joomla

  • click PHP tab
  • type echo date

  Check the PHP manual for instructions on the code for dates here. Sorcerer will add the PHP open and closing statements for you.

Add code to articles and modules in Joomla

  • click Insert button
  • type Copyright in front of {source}

Add code to articles and modules in Joomla

  • click Save & Close button
  • refresh your site page

Now the date on your site is correct. 

NOTE: You can use Sourcerer in any article or module in Joomla and not just for PHP, but for advanced CSS, HTML, and pretty much any code you want without fear of having your wysiwyg editor strip it out or ruin it.

Thanks for tuning in today.  This is OSTips from OSTraining, and I'm Rod Martin. 


About the author

Rod holds two masters degrees and has been training people how to do "things" for over 25 years. Originally from Australia, he grew up in Canada and now resides just outside Cincinnati, Ohio.