Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joomla 3 Template override a plugin

I could not find any info on overriding a Joomla plugin in my template. Some forums claimed there was no plugin override, and the Joomla documentation (being the menacing forest that it is) either has nothing on the subject, or the page is hard to find.

So how can we override the output of a Joomla plugin in the same was we override the output of com_content or mod_contact?

like image 589
Dean Avatar asked Jun 28 '13 19:06

Dean


1 Answers

I have found a way to do this:

  1. Navigate to <joomla_homefolder>/administrator/language/<your_language>/
  2. Search for the plugin's corresponding language file.
  3. Copy the file name, EXCLUDING the language prefix (ie en-GB.) and the .ini suffix.
  4. In your template create a folder named html (a common practice for template overrides).
  5. In the html folder create a subfolder and name with the language file name as you copied it in step 3.
  6. Navigate to the tmpl subfolder in the plugin's path: <joomla_homefolder>/plugins/<plugin_type>/<plugin_name>/tmpl
  7. Copy the view file you wish to override into the folder you've created in step 5.
  8. Modify the copied file to override the plugins output.

For example - To change the page navigation buttons - modify the output of <joomla_homefolder>/plugins/content/pagenavigation:

Go into <joomla_homefolder>/administrator/language/en-GB/ and find the file named en-GB.plg_content_pagenavigation.ini.

From the filename copy only plg_content_pagenavigation.

Create a folder named html (If it does not exist already) in your theme, inside it create a subfolder and name it plg_content_pagenavigation.

Copy the view file <joomla_homefolder>/plugins/content/pagenavigation/tmpl/default.php into the plg_content_pagenavigation folder you just created.

Modify the file.

Note: I have tried it only with Joomla 3.1. The method may not work with some plugins.

Good Luck.

like image 51
Dean Avatar answered Jan 03 '23 23:01

Dean