Hey there,
i love using Layouts with Blocks. With the cookbook for the block factory its very brilliant to create modular pages.
One thing i would love to do is the following:
inside the settings-drawer for the layout-blueprint i added some custom fields like background-color or spacing options. But is there any way to show those settings in the blueprint?
For example: Inside a custom block i can define a field for background-color and with Vue.js i add a class to the template for the panel. Now i can style it via css. Is something similar possible for the Layout-Settings output?
This is an older post, but I’m curious if you - or anyone - tackled this. I’m in need of a preview as well; there is a switch to show parallax image(s) as background. But when there is no Block in the layout defined the layout looks empty - I like to show the (first) backgroundimage in the panel as preview so client is not inclined to accidently delete this layout because it looks empty
I created a plugin for my blog. In the template in index.js I assigned a class to the elements and styled this class as follows. In my example it is a banner image with a heading.
What you mentioned here is fine to display the settings of a custom block. I uses this as well in my previous setups, but it doesnt help to get the informations from the layout settings. because they are not part of the block.
i like the wysiwyg aproach in the panel, but since using kirby four i changed all my custom blocks to use preview: fields instead of creating a whole vue-view for every block. its very time consuming.
Anyway it would be awesome to have the option to give a class to the layout-element in the panel to show that it has a background color or something like that…
Oh I missed that you need this options for the Layout Sorry!
You’re absolutely right - it would be awesome to have the option!
Thank you for the “preview: fields” tip but when I need a “real preview” (like the image with an opacity) i have to work with the vue-view!
Or am i wrong?
yes thats true. if you need a real preview you should write yourself a vue-view.
I personally think its ok in the panel to just have all options and see the fields inside the layout grid. Therefore i made blueprints with two tabs for each block. One with content and one with settings. So i dont have to open the drawer everytime i want to change something like text alignment.
now I’m at the point where I have to pick it up again. Where can I find layout.vue? (Kirby v4.3.0)
Do I have to edit the core file or is there a way like with the blocks? (snippets/block/…)