amteich / kirby-twig

Twig templating support for Kirby CMS
MIT License
48 stars 12 forks source link

Possibility to render block template in block preview #29

Closed qroac closed 2 years ago

qroac commented 2 years ago

I recently changed my backend and frontend code from kirby-builder towards the official kirby-blocks.

With kirby-builder it was quite easy to get a preview of the page contents by using a 1-line PHP file using the twig-function and defining a required CSS file. Using this, kirby-builder created an iframe showing the current content of the block using the intended template.

If I understood the documentation correctly, with kirby blocks I'd have to rewrite the entire template code as vue-template to get a working preview of the contents. I wonder, is there any way to achieve a simmilar outcome as with kirby-builder. Of course, live editing wont work if it is not a vue template, but an iframe rendering the actual twig template would be fantastic.

Does anyone know a workaround to render a block preview using the actual twig templates?

seehat commented 2 years ago

That's a good question. I currently don't know how to tackle this. I suggest you create an issue in the Kirby Repo, as blocks is a core feature: https://github.com/getkirby/kirby