Joomla Plugin Events

Joomla has a variety of core events, organised into groups.

Authentication

Authentication events are triggered during the user authentication process.

1. onUserAuthenticate

This event is triggered to verify that a set of login credentials is valid.

Captcha

1. onInit

Event called to initialise the captcha. It returns Boolean true on success, false otherwise.

2. onDisplay

3. onCheckAnswer

Content

Content events are triggered during the content creation process.

1. onContentPrepare

This is the first stage in preparing content for output and is the most common point for content orientated plugins to do their work. Since the article and related parameters are passed by reference, event handlers can modify them prior to display.

Results are returned by modifying the referenced arguments. Sometimes a boolean might be returned to check for success or failure of the event.

2. onContentAfterTitle

This is a request for information that should be placed between the content title and the content body. Although parameters are passed by reference, this is not the event to modify article data.

Returned value from this event will be displayed in a placeholder.

3. onContentBeforeDisplay

This is a request for information that should be placed immediately before the generated content. Returned value from this event will be displayed in a placeholder.

4. onContentAfterDisplay

This is a request for information that should be placed immediately after the generated content. Returned value from this event will be displayed in a placeholder.

5. onContentBeforeSave

This is an event that is called right before the content is saved into the database. You can abort the save by returning false.

6. onContentAfterSave

This is an event that is called after the content is saved into the database. Even though article object is passed by reference, changes will not be saved since storing data into database phase is past. An example use case would be redirecting user to the appropriate place after saving.

7. onContentPrepareForm

This is an event that is called before a Joomla! Form is rendered. It can be used to modify the Form object before rendering. For example, use JForm->loadFile() to add fields or JForm->removeField() to remove fields. Or use JForm->setFieldAttribute() or other JForm methods to modify fields for the form.

Parameters: $form, $data

Return Value: (boolean) True if method succeeds

Examples: PlgUserJoomla, PlgUserTerms

8. onContentPrepareData

This is an event that is called after the data for a JForm has been retrieved. It can be used to modify the data for a JForm object in memory before rendering. This is usually used in tandem with the onContentPrepareForm method - this event adds the data to the already altered JForm.

9. onContentBeforeDelete

This is an event that is called right before the content is deleted from the database. You can abort the delete by returning false.

10. onContentAfterDelete

This is an event that is called after the content is deleted from the database. An example use case would be redirecting user to the appropriate place after deleting.

11. onContentChangeState

This is an event that is called after content has its state change (For example, Published to Unpublished).

12. onContentSearch

This event is triggered by a variety of search related operations. It is a request for a plugin to return the result of a search request. The rows must return the following fields, which are used in a common display routine: browsernav, catslug, created, href, section, slug, text, title

13. onContentSearchAreas

14. onContentValidateData

Editors

1. onInit

2. onSave

3. onSetContent

4. onDisplay

5. onGetContent

6. onGetInsertMethod

Extensions

onExtensionAfterInstall

onExtensionAfterUninstall

onExtensionAfterUpdate

onExtensionBeforeSave

onExtensionAfterSave

onExtensionAfterDelete

Finder

onFinderCategoryChangeState

onFinderChangeState

onFinderAfterDelete

onFinderAfterDelete

onFinderBeforeSave

onFinderAfterSave

Privacy

onPrivacyCanRemoveData

onPrivacyExportRequest

onPrivacyRemoveData

Quick Icons

onGetIcons

System

As system plugins are loaded before any other event group, they may also contain any other event.

1. onAfterInitialise

This event is triggered after the framework has loaded and the application initialise method has been called.

2. onAfterRoute

This event is triggered after the framework has loaded and initialised and the router has routed the client request. Routing determines which component should receive the request. The component optional parameters are then set in the request object that will be processed when the application is being dispatched.

3. onAfterDispatch

This event is triggered after the framework has dispatched the application. Dispatching is the process of pulling the option from the request object and mapping them to a component. If the component does not exist, it handles determining a default component to dispatch. When this event is triggered the output of the component is available in the document buffer.

4. onBeforeRender

This event is triggered immediately before the framework has rendered the application.

5. onAfterRender

This event is triggered after the framework has rendered the application. When this event is triggered the output of the application is available in the response buffer.

6. onBeforeCompileHead

This event is triggered before the framework creates the Head section of the Document.

User

1. onUserAuthorisation

This event authorises that a particular user should be able to login. The system triggers this event after the user has been authenticated and before he has been signed in the website.

2. onUserAuthorisationFailure

The system triggers this event when the user has been authenticated but he has not been authorised to login. You should only use this event in User plugins.

3. onUserBeforeSave

This event is triggered before an update of a user record.

Parameters: $olduser, $isNew, $newUser

Return Value: Boolean. Any plugin that returns false aborts the save.

Example: PlgUserTerms

4. onUserAfterSave

This event is triggered after an update of a user record, or when a new user has been stored in the database.

Parameters: $user, $isnew, $success, $msg

Examples: PlgUserJoomla, PlgUserTerms

5. onUserBeforeDelete

The event is triggered when a user is about to be deleted from the system.

6. onUserAfterDelete

The event is triggered after a user has been deleted from the system.

Parameters: $user, $success, $msg

Examples: PlgUserJoomla

7. onUserLogin

This event is triggered after the user is authenticated against the Joomla! user-base.

Parameters: $user, $options

Return Value: Boolean

Examples: PlgUserJoomla

8. onUserLoginFailure

his event is triggered whenever a user authentication request is failed by any plugin.

9. onUserAfterLogin

This event is triggered whenever a user is successfully logged in.

10. onUserLogout

This event is triggered before the user is logged out of the system.

Parameters: $credentials, $options

Return Value: Boolean

Examples: PlgUserJoomla

  1. onUserBeforeSaveGroup
  2. onUserAfterSaveGroup
  3. onUserBeforeDeleteGroup
  4. onUserAfterDeleteGroup
  5. onUserAfterRemind