简体   繁体   中英

Joomla plugin to add new functionality by infiltrating existing module or component

Is it possible - and is so what is the right way - to create a Joomla 3 plugin that ads new functionality to an existing module or component. I have made some minor but useful UI functionality changes to a popular component and module that I would share with others. I feel that editing the source is not the way, a plugin would be best. Thanks!

Yes, Its possible Joomla plugin is designed for that purpose,

You can add more features to existing component or module using Joomla plugin events.

There are many extensions that are using this concept like extending default users component com_users , com_virtuemart etc.

If you are using UI features I think System plugin will help you to solve the challenges

For an example I made a new feature to com_virtuemart with Product Zoom facility , It uses System Plugin events .

Hope it make sense..

I'm pretty sure there is no "right way" to do this, as Joomla is designed to only allow you to overwrite the views rather than the models.

(If you don't know how to do that - copy the component view's default.php file into your template to templates/yourtemplate/html/com_componentname/viewname/default.php. )

However, someone has written this to allow you to over-ride models - http://extensions.joomla.org/extensions/style-a-design/templating/15611 . Downloading their code and looking into it would probably give you a hacky way of doing it.

Their use of eval suggests that it is going rather outside the Joomla framework, however.

A list of events you can hook a plug-in onto is here: http://docs.joomla.org/Plugin/Events - you can search-and-replace variables and output at any of those points, though that is not really "infiltrating the existing module or component", as it will happen outside of that component being loaded.

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