I am making system plugin for Joomla 2.5 and 3.x that should check for different html overrides folder first before the templates/template_name/html , it works well but I honestly do not like it because it is a hack that can be easily killed by joomla update. For example to override module chrome
In my plugin I have :
public function onAfterInitialise() {
JLoader::register('JModuleHelper','path to my application module helper');
}
and in my custom helper.php I changed the JModuleHelper class method renderModule() to check for html overrides in following order:
check my plugin html folder if module override file is there use it
if no override in my plugin check template html folder
if none of the above use joomla default.
joomla default is:
check my template html folder if module override file is there use it
if no override in template html, use joomla default.
isn't there an easier way to achieve this ?
Any help is appreciated. Thank you!
The best way to achieve what I am after is this
http://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core
http://extensions.joomla.org/extensions/style-a-design/templating/15611
Related
My client is using the module Je Quick Contact in their site, in Joomla 3.7.3
As default, the sender email is user's one, but in that way sometimes email goes in spams.
We would like to change it to have a generic send contact#domain.fr, seems we can't handle it in Back-office.
So I tried to override the module to change the sender email.
The module was in modules/mod_je_quickcontact and there there is files mod_je_quickcontact.php, index.html, mod_je_quickcontact.xml and folder CSS, JavaScript, PHP, images
In my template I created a folder mod_je_quickcontact and I put there all thoses elements, and I changed the file mod_je_quickcontact.php
But it's not working, it's still default data which are displayed.
I looked at Internet to see how to override, but for all example I found, in default module there is tmpl/default.php file to override. I don't have such folder and file.
Maybe I missed something or I did it wrong... I don't know what to do know, so, if someone has an idea, it would be great!
I think in Joomla there is only a way to override a template or layout of modules. The module you used is not best practice, because there are not using a default template (tmpl/default.php) to display the output of the module.
Like in Joomla docs mentioned:
The directory structure you need is: TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php
(Source: Joomla override documentation)
What I would do: Copy the module, change it in the way you need it. That´s it.
There have to be a difference between paid and free modules :-P
I am overriding a particular template so according to rules the data is in html folder
and in virtuemart configuration setting the default view is selected properly
as the template name , but still the overriding doesn't work?
You have to put the modified file in template folder under: /your_template/html/com_virtuemart/.
Let's say that you want to modify this file:
/components/com_virtuemart/views/productdetails/tmpl/default.php
You have to copy it to:
/templates/your_template/html/com_virtuemart/productdetails/default.php
Reference: How to override the output from the Joomla! core
I want to build my first module for Joomla 2.5 but I have a problem. I want to have multiple templates for my module, and the admin of the site can choose the templates from the config of the module. How can I do this ?
You are planning to create a joomla 2.5 front end module.then you can achieve your requirement as follows
You can use the joomla module override concept.
For each template you are using you can write module inside template folder for overrides.
like as follows
TEMPLATE_NAME/html/mod_login/default.php
for more details take a look at this.
I hope this will solve your issues..
I am trying to override the com_content/views/article/view.html.php file in joomla using the instructions given in this page
It says I have to create a folder named 'code' in base directory and create the same directory structure. I tried it , but its not working. Can someone confirm whether its working.
Where should I create code folder? Is it on root of joomla installations?
PS- The edit is working correctly when applied on core file
You can override (nearly) any class in Joomla, if your class with the same name is loaded first. To ensure that, you need to create a system plugin.
Here is an example for root/components/com_content/views/article/view.html.php:
class plgSystemOverride extends JPlugin
{
public function onAfterRoute()
{
JLoader::register('ContentViewArticle', 'path/to/override.php', true);
}
}
CAVEAT: Overriding a core class can lead to problems with other extensions, if you're not very careful. For views, though, any interferrence with other extensions is less likely.
You can't override component controllers, models and views in core Joomla! without using a 3rd party plugin.
The plugin you need can be found here: http://extensions.joomla.org/extensions/style-a-design/templating/15611
The code folder then goes into your Joomla root unless you're overriding a back-end view in which case it goes into /administrator
Hope this helps :)
You can use the Class Overrider Plugin http://extensions.joomla.org/extensions/tools/development-tools/23994
just adding some simple human reading commands
I'm working for a government school and I'm trying to override the 'Latest News' module in my template. I've created the following structure in my template folder: template_name\html\mod_articles_latest\default.php
Locally it works well, overrides the module, but when I push it to the live site nothing happens. I don't have permission to see the FTP files, I can only work through the joomla admin area, so I can't do much on the joomla installation files to test anything.
My questions is: is there any way to not allow override module in Joomla 2.5? (because it seems that it is what is happening) or Am I doing something wrong, like the module name I'm using or something?
Thanks in advance!