Okay, so I have something that does not work although it should, and also some general questions about how best to tackle this. I’m writing a plugin (attaching Cloudinary assets to Grav pages) that has two special page templates, one of which has specific frontmatter. My goal is to change the Admin page form a little for the latter case:
- If the page is of type
cloudinary-single
and has nopublic_id
set in the frontmatter, show the Cloudinary upload widget (just a little javascript). - If the page is of type
cloudinary-single
and HAS apublic_id
set in the frontmatter, show a thumbnail of that remote file (I can build the url with the CloudinaryPlugin class I already have).
I’m not quite sure what would be the best way to accomplish this – if anyone could provide a general outline, that would be super helpful already!
What I have done so far is, I’ve followed the docs on creating custom page templates for admin panel. I’ve simply copied the blueprint to its respective folder and all the code into my plugin class and left the example field as is, just to see if this works, and it doesn’t. I have no idea why.
I have triple-checked all my functions and which events are registered and whatnot, and that extra field simply will not show up.
Here is the repository with the latest bits of code. Any help is much appreciated!