Note

Please note that the content on this page is currently incomplete. Please treat it as a work in progress.

This article was last edited by Wilsonge (talk| contribs) 22 days ago. (Purge)
Stop hand nuvola.svg.png This tutorial is for Joomla! CMS Version(s) Joomla 1.5   For a Joomla 2.5 tutorial, see:- this guide for new event names!

Content events are triggered during the content creation process. This may occur in views in the com_content component, or in other components or modules.

[edit] onPrepareContent

[edit] Description

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.

[edit] Parameters

[edit] Return Value

None. Results are returned by modifying the referenced arguments.

[edit] Used in files

[edit] onAfterDisplayTitle

[edit] Description

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. Use onPrepareContent for that purpose.

[edit] Parameters

See the onPrepareContent event for additional discussion of these parameters.

[edit] Return Value

String. Returned value from this event will be displayed in a placeholder. Most templates display this placeholder after the article separator.

[edit] Used in files

[edit] See Also

[edit] onBeforeDisplayContent

[edit] Description

This is a request for information that should be placed immediately before the generated content. For views that generate XHTML/HTML, this might include the use of styles that are specified as part of the content or related parameters. Although parameters are passed by reference, this is not the event to modify article data. Use onPrepareContent for that purpose.

[edit] Parameters

See the onPrepareContent event for additional discussion of these parameters. Note that unlike onPrepareContent, these parameters are passed by value.

[edit] Return Value

String. Returned value from this event will be displayed in a placeholder. Most templates display this placeholder after the article separator.

[edit] Used in files

[edit] See Also

[edit] onAfterDisplayContent

[edit] Description

This is a request for information that should be placed immediately after the generated content. For views that generate XHTML/HTML, this might include the closure of styles that are specified as part of the content or related parameters. Although parameters are passed by reference, this is not the event to modify article data. Use onPrepareContent for that purpose.

[edit] Parameters

See the onPrepareContent event for additional discussion of these parameters. Note that unlike onPrepareContent, these parameters are passed by value.

[edit] Return Value

String. Returned value from this event will be displayed in a placeholder. Most templates display this placeholder after the article separator.

[edit] Used in files

[edit] See Also

[edit] onBeforeContentSave

[edit] Description

This is an event that is called right before the content is saved into the database. Since the article object is passed by reference, you can make any changes you wish to the data. You can also abort the save by returning false. In this case the error set by calling $article->setError($message); will be displayed to user.

[edit] Parameters

[edit] Return Value

Boolean. Result will affect the saving process. See description for details.

[edit] Used in files

[edit] onAfterContentSave

[edit] Description

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.

[edit] Parameters

[edit] Return Value

None. Result will be omitted.

[edit] Used in files

[edit] onContentPrepareData

[edit] Description

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.

[edit] Parameters

[edit] Return Value

[edit] Used in files

[edit] onContentPrepareForm

[edit] Description

Called before a JForm is rendered. It can be used to modify the JForm object in memory 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.

[edit] Parameters

[edit] Return Value

[edit] Used in files

License: Joomla! Electronic Documentation License
Source page: http://docs.joomla.org/Plugin/Events/Content
Page retrieved: 0.216 seconds, 2.20 MB

Top