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

EE 2 Extension Hook help

Development and Programming

Andrew Gunstone's avatar
Andrew Gunstone
102 posts
15 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hey all,

I’m a bit confused as to which extension hook to use, and infact if there is an extension hook available for what I’m trying to achieve…

  1. Is there a hook that runs when a user opens an Entry EDIT page. It isn’t a worry for the new entry PUBLISH page. I just need it to know the entry_id for the entry being edited.

  2. I also need the hook for when a user leaves the edit page. This can be on submit if that is easiest.

I found the Tab file reference stuff in the Module development… and it has the PERFECT functions that I need… but unfortunately (for me!) it actually creates a tab… which isn’t required for my extension. sigh

Any help is appreciated.

Cheers.

       
Greg Aker's avatar
Greg Aker
6,022 posts
15 years ago
Greg Aker's avatar Greg Aker

Andrew,

Depending on what you want to do, something from the channel entries API sounds like what you need: (http://ellislab.com/expressionengine/user-guide/development/extension_hooks/api/channel_entries/index.html)

       
Andrew Gunstone's avatar
Andrew Gunstone
102 posts
15 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hey Greg,

Thanks for the super fast reply. Much appreciated.

Unfortunately the channel_entries api only triggers when you submit the entry (which is fine for my second point!), and not when you land on the Edit page.. I’m actually not trying to manipulate the entry information at all, just trigger a function (that requires the entry_id) when a user first opens the Edit page, and then again when they leave it.

I think I might be able to sort out something using:

  1. foreign_character_conversion_array - which apparently triggers on when loading any control panel page (and I will just have to identify that it is the editing page).
  2. entry_submission_end - which obviously triggers when an entry is submitted.

Do you think that this would potentially work? It just feels sort of ‘hacky’ using ‘foreign_character_conversion_array’ to do something that has nothing to do with Foreign Character Conversions!

Cheers

       
Greg Aker's avatar
Greg Aker
6,022 posts
15 years ago
Greg Aker's avatar Greg Aker

hrm.

you might be able to use sessions_start, or possibly an accessory. Assign it to just the publish page, and you’ll have the entry id from $this->EE->input->get(‘entry_id’).

       
Andrew Gunstone's avatar
Andrew Gunstone
102 posts
15 years ago
Andrew Gunstone's avatar Andrew Gunstone

Good thought about the accessory. I’ll look into it. I’m trying to keep it as simple as possible to setup, as I would like to release it (free!) to the community once done.

If I get ‘developer of the year’ for it on Devot-ee, I’ll give you all the credit. 😉

Cheers.

       

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.