Hello,
I want to use @bnomei’s excellent Janitor plugin to update specific fields on click, but for this to work, I need to use the $page variable - which has no context inside config.php.
your are right that the janitor job has no such context, no knowledge about the page object the button might be at because they are triggered useing a route. i wanted mine to work without the panel as well as a within.
but i agree that the page object might be useful in the job if it was a button. i will think about a solution and post asap.
This all felt very hacky and it won’t work, if the browser doesn’t send a referrer. But it worked in our case. Having the plugin pass the context directly would be really great!
PS: You’ll have to use kirby()->page() if you’d like this to work with drafts as well. Learning by doing …
i am making good progress on adding the context page. only thing left is actually getting the current page.uri in the vue component. does a field has access to the current page? maybe panel plugin guru @sylvainjule knows?
I guess that’s the best way, aside from this.$route.path (which returns the panel uri with / replaced by +) I don’t recall the field having access to the uri.