Reputation: 8065
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?
Upvotes: 5
Views: 10006
Reputation: 749
In joomla 3 you can override plugins output only, that's why the origin plugin must be implemented with a tmpl. The naming convention of the folder in you [template]/html is
plg_[type*]_[pluginElement]
Template overridden native joomla plugins is only the pagenavigation.
type* : obviously there's no sense to be other than content but if it's custom plugin no one can stop you.
Upvotes: 6
Reputation: 11
Elin's answer is not quite correct for Joomla 2.5-3.x. Some plugins do render screen output and have /tmpl folders that you may be able to override. See http://docs.joomla.org/Layout_Overrides_in_Joomla
In some cases you may need to create alternative views within the plugin /tmpl folder. For example, some of the simple, newer custom content components that use JForms let you add fields to com_content articles and select a view template for each field. Then overrides for com_content are generated dynamically to display the custom fields. Each field type can be displayed in the component area through plugins, or in a module, or within the template code, but it will use the /tmpl file you selected for the field in the CCK component. If there is a way to override the different field views from within the template folder, it must require an arcane menu structure I haven't been able to discover.
Upvotes: 1
Reputation: 45
On a Joomla 3.1 install, I am using the Simple Image Gallery plugin and I felt the need to override it in order to add extra functionality to each thumbnail of the gallery.
I copied all of the contents of <joomla_homefolder>/plugins/content/jw_sig/jw_sig/tmpl/
into the folder <joomla_homefolder>/templates/protostar/html/jw_sig/
and I was then able to modify both the default.php
file for output modifications, and the accompanying template.css
file for styling modifications. This successfully overrides the plugin's output without risking issues during future updates.
Of course, this will not work with all plugins, but it offers another alternative if you have a plugin that was nice enough to be developed with a tmpl
folder.
Upvotes: 2
Reputation: 8065
I have found a way to do this:
<joomla_homefolder>/administrator/language/<your_language>/
en-GB.
) and the .ini
suffix.html
(a common practice for template overrides).html
folder create a subfolder and name with the language file name as you copied it in step 3.tmpl
subfolder in the plugin's path: <joomla_homefolder>/plugins/<plugin_type>/<plugin_name>/tmpl
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.
Upvotes: 9
Reputation: 6755
No you can't override the same way because there is not tmpl folder because plugins really should not be rendering though of course a lot do. You probably need to clone the plugin and make a the layout your want possibly using a jlayout to make it easier to manage.
Upvotes: 1