Is it possible to override component model or view.html.php

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
anagai
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sat Jun 12, 2010 4:18 am
Contact:

Is it possible to override component model or view.html.php

Post by anagai » Wed Sep 01, 2010 6:14 pm

When developing with Joomla for awhile you will most likely end up modifying the component files. This is not the most ideal process, since when you upgrade you will lose all your changes to the component files that comes with Joomla. Upgrading Joomla is just simply replacing all the files. From the one and only article on the subject on the entire internet at
http://community.joomla.org/blogs/commu ... -html.html and other comments elsewhere looks like you cannot do model overrides. The article is not describing a true override. Its a method to override within the component. When you upgrade you will lose that override code. All the overrides should happen in the templates that you create.

User avatar
JLW
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 160
Joined: Tue Jan 02, 2007 5:30 am
Location: U.S.A.
Contact:

Re: Is it possible to override component model

Post by JLW » Thu Feb 10, 2011 5:31 am

The only way to do a model override is to copy the entire core component, hack the copy, and then package the copy as a new component under a new name.

So you have com_content and also com_my_content. Menu items can use one or the other. The result is independent of upgrades.

But if security becomes a problem on the original component, it will remain a problem in your component (long after the core component is upgraded).
---Jordan
http://www.UpgradeThat.com -- compare and save on computer upgrades
http://www.Accordionist.org -- the accordion community online

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Is it possible to override component model or view.html.

Post by mcsmom » Mon Feb 14, 2011 1:05 pm

No that is not correct.
You can override anything.

http://community.joomla.org/blogs/commu ... -html.html

You need to place what you want in a system plugin.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Locked

Return to “Joomla! 1.5 Coding”