Hi,
I'm not sure if the issue I was having is directly because of Layout builder library, but I'm not able to reproduce it without it.
Steps to reproduce (not 100% accurate, as I've done many tries):
* On a Page content type create a couple of view modes (at least 2 – teaser and full)
* Both uses Layout builder with different layout
* Create an entity reference field for referencing pages.
* Create a new Layout in layout library for Page
* Place the entity reference on it – set formatter to display Teaser view mode
* Create some content, make references – all should look fine at this point
* Go to the teaser view mode and do some changes – save
* Go back to demo page – the teaser are now rendered as a Full view mode (in case of one content type it will probably ends with some looping error, in case of two content types it just use the wrong template).
Are there some step I should avoid? E.g. don't use Layout builder on a Full view mode together with LBL?
This issue leads me to uninstall Layout Builder Library in the end.
I like the idea of the module, but in the end It was better for me to have view modes with layout than multiple full view mode variants.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Screen Shot 2019-06-18 at 6.48.32 am.png | 36.5 KB | larowlan |
| #10 | 3053965-8.patch | 4.56 KB | dejanp |
| #7 | 3053965-7.patch | 4.56 KB | dejanp |
| #5 | 3053965-3.patch | 1.29 KB | dejanp |
Comments
Comment #2
petr illekComment #4
Anonymous (not verified) commentedI have the same issue. A selected layout from the layout library applies to all view modes, not just on view mode where "Allow content editors to use stored layouts" option is enabled.
Comment #5
dejanp commentedThe selected layout from the library overrides all view displays.
It should probably check whether the option "Allow content editors to use stored layouts" is enabled on a specific display or not.
I'm not sure that this is the right solution, but it will fix the problem.
Comment #6
larowlanThanks for the patch, we need a test here too
We can inject this
we can just use
if ($entity_view_display)hereComment #7
dejanp commentedPatch update, including the test as well.
Comment #8
larowlanThanks
Comment #10
dejanp commentedI fix the test. It should pass now on Drupal 8.8.
Comment #12
larowlanComment #13
larowlanFixed on commit:
Cutting a new release
Comment #15
larowlanCut a new release, beta1 - thanks @pinkdexo
Comment #16
dejanp commentedThanks @larowlan :)