How to Override Almost Anything in Joomla Extensions

A Few Thoughts on Asset Overriding in Joomla

Did you know what it is possible to override almost of the output from Joomla extensions and templates?

It's possible to override images, stylesheets, scripts, layouts, templates and much more. This support for overrides in Joomla enables you customize anything you install on your site ... so long as you know the correct approach.

In this blog post, I'll give you a quick guide to overriding extension displays.

The most difficult thing for many Joomla users is knowing the correct file and folder structure to use for overrides. This table shows how to override specific parts of a Joomla extension:

Type Source Override
image /media/<EXTENSION>/images /templates/<TEMPLATE>/images/<EXTENSION>
stylesheet /media/<EXTENSION>/css /templates/<TEMPLATE>/css/<EXTENSION>
script /media/<EXTENSION>/js /templates/<TEMPLATE>/js/<EXTENSION>
layouts /components/<COMPONENT>/layouts /templates/<TEMPLATE>/html/layouts/<COMPONENT>
component templates /components/<COMPONENTS>/VIEWS/<VIEW>/tmpl /templates/<TEMPLATE>/html/<COMPONENTS>/<VIEW>
module templates /modules/<MODULE>/tmpl /templates/<TEMPLATE>/html/<MODULE>
plugin templates /plugins/<FOLDER>/<PLUGIN>/tmpl /templates/<TEMPLATE>/html/plg_<FOLDER>_<PLUGIN>

There will be situations where some these overrides won’t work, particularly with older or badly coded extensions. However, if your extension uses Joomla best-practices, you will be ablt use this guide to override the output.


An example extension: OCampus

OSCampus is the best Joomla Learning Management system and it makes for a good example of how to use overrides. In the table below, I'll show you the file and folder structure to use if you want to override OSCampus using the Protostar template.

Type Source Override
image /media/com_oscampus/images /templates/protostar/images/com_oscampus
stylesheet /media/com_oscampus/css /templates/protostar/css/com_oscampus
script /media/com_oscampus/js /templates/protostar/js/com_oscampus
layouts /components/com_oscampus/layouts /templates/protostar/html/layouts/com_oscampus
component templates /components/com_oscampus/views/pathway/tmpl /templates/protostar/html/com_oscampus/views
module templates /modules/mod_oscampus_search/tmpl /templates/protostar/html/mod_oscampus_search
plugin templates /plugins/oscampus/simplerenew/tmpl /templates/protostar/html/plg_oscampus_simplerenew

It's worth noting that OSCampus uses the basic Joomla override system, but is also more advanced. OCampus has a theming system built into it. You may find that this is true of several more modern Joomla extensions. In addition to the above overrides, when a named theme has been selected, the following can be used to override theme-specific files:

Type Source Override
stylesheet /media/com_oscampus/css/themes/<THEME-CSS-FILE> /templates/<TEMPLATE>/css/com_oscampus/themes/<THEME-CSS-FILE>
layouts /components/com_oscampus/layouts /templates/<TEMPLATE>/layouts/com_oscampus
templates /components/com_oscampus/views/<VIEW>/tmpl
or /components/com_oscampus/themes/<THEME>/<VIEW>
/templates/<TEMPLATE>/html/com_oscampus/themes/<THEME>/<VIEW>

More about Joomla overrides

If you want to find out more about Joomla overrides, we have a lot of information on this blog and inside Joomlashack University. The best place to start is this overview of all our Joomla override tutorials.