0

I'm trying to trigger some actions for example when a content article is saved (using onContentAfterSave) or when a event from jEvents (https://www.jevents.net/) is saved (using onAfterSaveEvent). The last one is a custom event that is not present on the core Joomla groups.

Is it possible to create a single plugin that can listen to events of different groups or do I need to create multiple plugins for this purpose?

1 Answer 1

2

Yes, as long as the plugin is instantiated. This is done when the plugin group is imported. The common way is to create a plugin in system group because those are always imported. Beware that plugin execution order depends on group import order. Since system plugins are imported very early, they'll run before any other plugins.

2
  • Custom plugin groups can't achieve this behavior right? Another question, can components listen to events? I would like to avoid plugins, since I already got a component.
    – Exprove
    Commented Mar 3, 2021 at 16:46
  • Not without a system plugin first to import the groups. Same goes for a component.
    – Sharky
    Commented Mar 4, 2021 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.