-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add is_frontedit GET parameter #1666
base: 6.dev
Are you sure you want to change the base?
Add is_frontedit GET parameter #1666
Conversation
Let add-on developers easily distinquish what is a Frontedit request and not a Frontedit request to change behaviors.
fc6e364
to
390c04e
Compare
Examples/use cases of when a developer can avoid excessive code and/or scripts from being included on the front-end than are needed.
From another project...
|
@litzinger sorry it took me so long to get back to you on this. I do not like the idea of adding an extra
I am also not sure I understand the particular case of adding GET variable to Tagging @TomJaeger for any additional thoughts |
The cp_js_end hook is a separate call entirely, so it has no idea what the context is. Only the calling script/request has access to I'm not sure why adding a new variable is not a good idea. The only way to figure out how to do this (as with many other things in EE that isn't documented) is to inspect everything about the request and code behind the feature. So you're expecting someone to figure out what Please re-consider this request. |
Overview
Let add-on developers easily distinquish what is a Frontedit request and not a Frontedit request to change behaviors. Currently the only way to accurately test for this is something like this, which is a bit excessive. Having a single value to check would be easier, and also passing that value through the cp_js_end hook to those Ajax requests know their origin.
This change also requires a small update in the FrontEdit.php service file when creating the url:
I can't seem to make this change though because the Pro module is not in Github :(
Nature of This Change
Is this backwards compatible?
Documentation
Not sure this requires a documentation update? Though I would consider adding something to the
cp_js_end
hook informing developers if they're using this hook to examine what they're doing because the Frontedit requests are not full control panel loads, so if they are adding JS to the page to modify something that isn't in the Frontedit modal, they could be adding excessive and unnecessary JS to the page load.