No, I’m afraid there isn’t, you would have to spell them all out. Assigning the same model to all page types is already a shortcut. It doesn’t look as if there was an easy way to create a custom page class (ie. directly extend the Page class without the model), because the Page class is too deeply interwoven.
Do you really need this for all page types? What exactly is your use case for post-processing page output?
Alright, no problem then.
Your help is greatly appreciated.
Basically I can’t stand the output code. It’s a pain in the eye for me.
It has weird indentication, HTML-comments, empty lines, tags spread over multiple lines, etc.
I decided to go the route of clean, readable templates for comprehensible development.
Unfortunately PHP (as a templating language) does not reward it with adequate generated code.
So… I decided to not care about how I need to template to make the generated code look good, but instead I take a code-hammer at the end.
Currently using PHP Tidy for all mentioned above. If problems occur (markup, performance) it can be changed in one place (now).
I wonder if the approach used in the kirby-minify-html plugin could work for you. I am not quite sure how the plugin hooking into the ‘template’ config compares to the Page Model approach outlined above, including the wish for it to happen pre-caching…
It sounds like your desire to clean up the final HTML code is very similar to the strategy of HTML minification. Maybe this discussion is of interest to you?
Yes! You are absolutely right. Your links were my starting point some weeks ago
I have previously installed this plugin and a previous kirby-installation has it still running.
Now, since I’m digging deeper in Kirby (it becomes my main CMS after all?), I am fine-tuning the processes/code-basis for the projects-needs.
At the moment I am using an own “default-project”-plugin-method to deliver the desired output. Seems to work for now. To be continued