Trigger specifications

19 views
Skip to first unread message

Ian

unread,
Feb 4, 2009, 12:02:29 PM2/4/09
to Joomla! General Development
So, events are supposed to be pretty cheap in 1.6, and one of the
desired tasks for 1.6 is to add events to improve the flexibility of
both the framework and the CMS.

Instead of numerous people randomly adding events willy-nilly, it
would seem to be better to create some specifications first and to put
some thought into it.

To that end, I created a page on the wiki that will be used to detail
the different events that we will add.

You can find it at: http://docs.joomla.org/16Events

Perhaps we should put out ideas here first and then edit the wiki when
we have some idea of what we're doing.

Comments, questions, appreciated.

Rob Schley

unread,
Feb 4, 2009, 5:41:51 PM2/4/09
to joomla-de...@googlegroups.com
Hey Ian,

During the Dev summit we outlined the basic event changes we wanted to implement (I admit, I was a driving force behind this topic). I am going by memory but hopefully one of the other guys can jump in and confirm this:

onBeforeRender - This is a new event fired in between template parsing and buffer population.  (done)
onAfterDisplayCache - I'm not sure that is the exact name but this one is fired after a page cache buffer is displayed. (done)

onPrepareContent - Rework to use JContent and apply to all content types (article, web link, contact, etc.).
onAfterDisplayTitle - Rework to use JContent and apply to all content types.
onBeforeDisplayContent - Rework to use JContent and apply to all content types.
onAfterDisplayContent - Rework to use JContent and apply to all content types.
onBefore/AfterSaveContent - Apply to all content types.

The user events are being reworked quite a bit and a couple new ones are being added due to the new member management system that is being put in place. This is a work in progress but expect to see events for hooking into user forms via the new JForm package and the onBefore/AfterStoreUser events are being reworked to pass the whole user object rather than just the properties.

I think it is important for us to discuss events on list because adding them haphazardly all over the place is just going to lead to a bunch of confusion and trouble. If there are any questions about the purpose of those events, please ask. If there are specific other proposals, let's discuss them.

Best,
Rob

Anthony Ferrara

unread,
Feb 4, 2009, 6:00:40 PM2/4/09
to joomla-de...@googlegroups.com
I've got quite a bit of this done (for JContent at least)...  I need to check trunk to see if I committed it...  But basically, all the com_content triggers get reduced to 2 onContentPrepare, and onContentDisplay (both handled by JContent)...  Let me make sure it's in, and I'll give ya a rundown of how and why...

The onBeforeRender and onAfterDisplayCache are already implemented...

One thing we decided, was to "namespace" all events.  Current namespaces are (Forgive me, memory is fuzzy) Form, Content, User, and one more I'm forgetting (installer maybe?).  System events don't have a namespace.  So, the naming convention is "on[NameSpace](before|after)[Event]"  Hence why onContentPrepare and onContentDisplay instead of onPrepareContent and onDisplayContent... 
Reply all
Reply to author
Forward
0 new messages