I’m working on a port of an EE2 add-on which injects some javascript into the footer of the CP in order to add some markup to the page (specifically, I need to inject markup and load javascript on the CP homepage). Previously I did this with an Accessory.
I’ve been trying to use sessions_end
, but as I’m sure you know that is very, very limited (there are seemingly a tonne of framework features which aren’t ready to be used yet when that hook is called).
I did try the hack outlined somewhere here on the forums whereby you manually assign the session object to ee()
, but even then, ee()->cp
is was available (error thrown in the legacy Facade).
Is there a way forward here, or am I currently screwed with the death of Accessories?
sessions_end
is a little confusingly named, since it’s the end of the Session class instantiation, and not the end of the session or late-game processing. So it’s actually nearly as early as sessions_start
.
James is working on some things to allow customization of the CP homepage, primarily targeting things like this that people used to use Accessories for. Can you describe in more detail what you are wanting to display for the user? Having details on the use case will help us build that functionality in a way that’s more likely to meet your needs.
In the meantime can you use the cp_js_end hook?
I’ll try cp_js_end
again - it didn’t work for me when I tried to port my old code over because it expected to be loaded directly in the footer via ee()->cp->add_to_foot()
, which in my testing didn’t work inside of cp_js_end
. I’ll try some refactoring there and see if I can get that hook to work.
It’s a new/different version of CP Analytics I’m working on.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.