Antoine
Antoine

Reputation: 165

How to modify com_mailto to fit out needs

I'm developing a site for my company and I also need to modify the native component "mailto" to fit our needs. I'm working with a joomla 2.5

I was wondering if future updates occur, what will happen to the lines I've added, for example, in "\components\com_mailto\controller.php"...

I haven't find answers on the net.

Also, for the same reason, I've modified the default layout of an article. Should I rename it? and if yes, how, because I couldn't do it (when I've tried the article did not display).

Thanks for your help

Upvotes: 1

Views: 252

Answers (2)

Valentin Despa
Valentin Despa

Reputation: 42622

While the answer from Lodder is totally valid, as a last resource you can also consider forking the com_mailto as a separate component.

This has some disadvantages:

  • you need to rename all the files involved (controllers, models, views)
  • you need to maintain it and keep in in sync with future updates (consider than you are now on 2.5.x and in a year you might want to upgrade to 3.x).

Upvotes: 1

Lodder
Lodder

Reputation: 19733

Before starting to edit core Joomla components, should should always have a look at the options you have. I don't believe in editing core file as it simply causes problems for updates when released, therefore in my opinion, you have 2 options:

  1. I always make a note of all my requirements and start looking for a 3rd party extension that caters for my requirements.
  2. If I cannot find a 3rd party extension and don't particularly want to start digging into it's code, I would go with developing a plugin. Plugins are used to manipulate the behavior or something and therefore come in extremely handy for when you would require core editing.

Editing the layout of an extension view is completely fine, but it's strongly recommended you make a Template Override so that if the extension does ever get updated, your changes won't get overridden.

So to answer you initial question, any line you have added to the controller.php file will get overridden when you decide to update the extension.

Hope this helps

Upvotes: 2

Related Questions