OSTips -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:
- The ability to include other files and select your include method.
- Some advanced security settings that are really worth it.
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
- 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.
- click Insert button
- type Copyright in front of {source}
- 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.
This website will really help everyone in providing the tools and information necessary for the people to develop and improve their website.