In my EE 2.0 site, I have a channel called “people,” with a boolean field called “featured.” Only one person from the “people” table can be the featured person at any given time.
My goal: If I’m creating a new person or editing an existing one, and I check the “featured” checkbox, then upon saving that record, all of the other people already saved in the channel should have their “featured” status set to 0. (Of course, this change should only affect one record at most.)
It seems like an extension is the best way to achieve this. (Please correct me if I’m wrong about that.) I’ve been searching all over, but I can’t figure out which hook to use, to insert post-processing logic when a channel entry (new or existing) is saved.
• If I use “foreign_character_conversion_array,” it fires whenever the control panel loads – not just when I hit save. • If I use “entry_submission_end,” it doesn’t seem to fire at all – even when saving an entry.
Am I going about this the right way? And if so, which hook should I be using?
Thanks, Charles
In EE 1.x, I want to trigger an action (specifically, send email to members of a newsgroup) when a new entry is published to a specified channel with status ‘open’ or when an existing entry is edited and its status field changed to ‘open’. What hooks should I use in writing the extension, and how can I check the former status and the new status of an entry undergoing edit?
The newly published article can be trapped using the ‘submit_new_entry_end’ hook and I can test $data[“weblog_id”] and $data[“status”] and test $IN->GBL(‘C’) == ‘publish’. What do I do to trap the edited entry whose status is being changed to ‘open’?
Thanks, Aharon
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.