简体   繁体   中英

Joomla Component Override

By default Joomla has a components/com_users component. Basically, I want to have new user component without editing the existing one.

I want to add new functions/edit existing functions.

How can I do this?

Right now, I just edited the files in the com_users folder but I am sure that's the right approach.

You can modify the look of com_user pages by overwriting views templates in folder: templates/{your template}/html/com_user. You can do this without any problems.

But if you are modifying controllers/models/views code than you must be aware that when you will update Joomla then your changes could be overwritten by updated files. So you can stop updating Joomla on your site (not good idea) or on every update check if your modifications wasn't overwritten and if yes add them again (also not good idea because you will do the same work many times).

So, in my opinion, if you must change code of com_user controllers/models/views then write your own component (you can use code from com_user in your new component for start).

Use a plugin, is easy.

Profile plugin is a new extension in Joomla! 2.5. It allows the addition of supplemental fields in the registration and profile forms of the com_user front end and in the user create/edit form in the back end.

https://docs.joomla.org/Creating_a_profile_plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM