We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Create a flag per channel entry to check before firing extension

Development and Programming

ThorntonStuart's avatar
ThorntonStuart
2 posts
8 years ago
ThorntonStuart's avatar ThorntonStuart

Hi,

Just as a foreword, I am a complete noob to EE development. I am trying to develop an entry-cloning module using the after_channel_entry_save hook and the Channel Entries API to duplicate the metadata and custom fields. Currently the extension does what I want it to do, only it fires on every channel entry. Ideally I’d be able to wrap all the code in my hook method in a conditional to check a yes_no which determines whether or not to clone this entry. Having this in plain sight on the publish page would be my ideal goal, though I realise it is like unachievable.

I am currently trying to achieve this effect by packaging a module with the extension and using a tab to update the $settings array and update/insert the db, however I’m probably going to have to use the after_channel_entry_save hook in my tab save method, meaning the database won’t be updated before the conditional evaluates false and nothing happens.

Would there be an easier way to develop some sort of flag for this rather than packaging a whole module with the extension just for tab functionality?

Thanks

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.