tags:

views:

400

answers:

2

Hi,

I have a template that need to override the joomla module method (not template). I know how to override the template (tmpl) by creating /html/mod_abcd/ ... but is it possible to override the joomla module just for my templates ?

I am using mod_frontpage and it seems the mod_frontpage delete things inside bracket ({ ... }) so i just need to modify some lines of code. If it is possible, I would like to override the methods and not change the core itself.

is that possible ? and how to do that ...

thanks in advance ...

+1  A: 

If you want to override the method, fist you need to find out what class the method resides in. Once you find that, you can create a new class:

class class_name extends joomla_class_name{

    function method_you_want_to_override(){
        //New stuff here
    }

}

If the class is defined as a "final" class in Joomla using the final keyword, it's a method that you can't override. To enable overriding, you'd simply have to remove that keyword from the method declaration in the parent class.

BraedenP
where i have to save this file ? i am going to use for my template only.
nightingale2k1
You'd have to include the file with the original class in your new file.. Then after extending the class in your new file, you can override and use the new method.
BraedenP
A: 

Your best shot would be to fork mod_frontpage and create your own module based off it. The template overrides are for markup only.

jlleblanc