48 Hour Sale: Save 40% on ALL products for the next 48 hours! Use the coupon: SEPT40  Sale ends in
Joomlashack

How to Create Template Overrides for Joomla Plugins

How to Create Template Overrides for Joomla Plugins

Despite being tremendously useful, template overrides for plugins are a type of override that is barely known in Joomla community.

There is no way to create this type of override from the Joomla backend. It is a completely manual process. Template overrides for plugins are intended for extensions that output content in frontend. This means just a few plugins are ready for this feature.

In this tutorial, we will show you how to easily create plugin overrides in Joomla.

The plugins that have a tmpl folder with the output files in there, are the ones that are ready for overrides. A good example is the page navigation plugin, that prints the “prev” and “next” links in a single article.

Step #1. Create the plugin override

Let’s create a plugin override taking as an example the Page Navigation plugin for articles.

  • Go to: plugins / content / pagenavigation / tmpl folder
  • Copy the file default.php

How to Create Template Overrides for Joomla Plugins

  • Paste default.php in a new location inside your template’s folder in: templates / your-template / html / plg_content_pagenavigation

How to Create Template Overrides for Joomla Plugins

The folder name "plg_content_pagenavigation" is the result of this structure: "plg_PluginType_PluginName".

  • PluginType = content
  • PluginName = pagenavigation

If you are creating an override for another plugin, follow the same pattern to name the folder within your template.

Step #2. Customize the plugin override

  • Edit the file default.php you just copied. Change the HTML according to your needs.

How to Create Template Overrides for Joomla Plugins

In my case, I changed the html that rendered the navigation links. Instead, I gave them the aspect of buttons with more color.

Step #3. End result

  • This if how the default page navigation links look in Protostar template:

How to Create Template Overrides for Joomla Plugins

  • After my customizations, this is the end result:

How to Create Template Overrides for Joomla Plugins


About the author

Valentín creates beautiful designs from amongst the tequila plants of Jalisco, Mexico. You can see Valentín's design work all over this site and you can often find him helping members in support.

 

 

Since 2005, Joomlashack has been a leading supplier of free and commercial Joomla templates, Joomla extensions, and Joomla Training.
Joomlashack.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.