I’m exploring some options to build some custom functionality in Statamic. My preference would be to use the normal page builder to associate a custom block with a particular page. But – the custom block needs to do some preprocessing before rendering itself.
Is it possible to invoke a controller before Statamic renders a particular block? I don’t want to create a normal Laravel route and controller for this, as it must operate within the context of the page builder functionality, and the users must be able to manage surrounding blocks on that page in the normal fashion.
Or, is there a better approach I’ve not considered yet?
The documentation details how to create a controller and render a Statamic view, but that’s insufficient for the requirements.
ThePringlesAddict is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.