-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
[4.x] Ability to add inline scripts into the CP #9386
Conversation
Oh man I've wanted this for ages <3 |
FYI You can already inject your own components onto the page: https://statamic.dev/extending/vue-components#appending-components |
Oh I misread and thought this was for the frontend. 😬 |
Yeah at first I thought the method named was going to need to change because it implied the frontend. But I see we have a bunch of others like |
Oh nice! Didn't know that. In that case we might not need this 😂 . Still, might be a useful addition. |
@jacksleight I've replaced what you've done with a I'd rather not start allowing completely arbitrary stuff unless it's absolutely needed. With the combination of this and the existing way of appending Vue components, you should be able to do what you need. Let me know! |
Sounds good! Totally get not wanting to allow any old HTML, something more specific makes sense. We've actually managed to do what we needed with the component append method you mentioned, but this could still be useful for other things. |
Cool I'll merge this with just the inline scripts then, but if you find a need for one of those other things, we can revisit. |
This PR allows you to inject custom HTML into the head or body of all CP pages, eg:
Our use case for this is to embed a custom Vue component that will display a modal overlay in certain circumstances.
Other use cases include: