Set different preview layout for the builder
See original GitHub issueMaybe there is a simple way to do this but something as simple as fractal.components.set('builder.preview', '@anotherpreview');
isn’t working.
Any other way to do this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Layout Builder: Single Templates - YouTube
In addition to index (archive) templates, Pro's Layout Builder allows you to create beautiful blog posts and more.
Read more >Getting Started with Layout Builder in Drupal 9 - Specbee
Scroll to the bottom and click on Layout options and select “Use Layout Builder”, then click on Save.
Read more >Build a UI with Layout Editor | Android Developers
Introduction to the Layout Editor · Change the preview appearance · Create a new layout · Use layout variants to optimize for different...
Read more >Allow Layout Builder live previews to be toggled to ... - Drupal
Provide a toggle that replaces live preview with a helpful description of what the block represents. The setting for the toggle should persist ......
Read more >Auto Layout Guide: Working with Constraints in Interface Builder
There are three main options for setting up Auto Layout constraints in Interface Builder: You can control-drag between views, you can use ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, i solved it.
The important part is
fractal.components.set('files.preview', '@build');
The Docs only mentiondefault.preview
but notfiles.preview
. I’m not sure it this is a bug or if the Docs are wrong or if i misunderstood something completely but this works for now.✌️
I investigated this a bit. Working as expected in my testing.
The
files.preview
setting is used to look up a default preview file for a directory - e.g. if you have apreview.hbs
in yoursrc/components/collection
folder, that preview file is automatically used for components in that collection. So this issue seems to happen only with some specific file structure that I haven’t been able to replicate. Essentially if you have a preview template file in a collection directory, that preview is used instead of the default preview. If anyone running into this can provide a repository with this issue present, it would be great.Either way, I’d like to know what the usecase is for using different preview templates serving/building and if maybe this would be better solved by conditional statements in a single preview template.
Closing this again, feel free to comment if any new info pops up and I can revisit this issue.