- π¬π§United Kingdom nigelwhite Marsden
I'd like to add some detail in case someone with more Drupal skills than me can make something of the symptoms
Steps to reproduce........
- create a ui_pattern eg Modal
- test that it works by creating a content type 'Test Modal'
- add the fields to the content type
- set the layout for the content type as Modal
- create a node of type Test Modal
- save. It displays the modal button and clicking it opens the modal message
- Crate a paragraph type and create the fields
- because we have ui_patterns_layouts module, in manage display we can select the layout 'Modal'
- in a different content type (eg Test) add an 'entity reference revisions' field
- call it 'components' or some such
- edit the field and allow Modal to be used in this content type
- select Layout Paragraphs widget in Form Display and Manage Display
- at last we can create a node of type Test
- add a Section and pick a layout
- inside the section, add a Modal
- we get the Modal form asking us to enter data in the fields
- save
- the modal is now showing in the text editor window
- save the node
- modal is gone. It's not in the DOM at all.
According to this documentation β the two should work together
- πΊπΈUnited States andrewmriv Southern California
I am able to use UI Patterns with Layout Paragraphs.
Do UI patterns work outside of Layout Paragraphs?
If you make another content type with regular entity reference fields do UI Patterns work? - Status changed to Closed: cannot reproduce
almost 2 years ago 5:03pm 22 February 2023 - π¬π§United Kingdom nigelwhite Marsden
Thank you for looking into it @andrewmriv. I'm glad it works for you - so maybe there's something funny in my environment that stops it working....... that is kinda hopeful.......
In response to your questions - yes ui_patterns outside of layout_paragraphs does work. Please see no. 2 in 'steps to reproduce'
To test the ui_pattern in isolation from layout_paragraphs........
test that it works by creating a content type 'Test Modal'
add the fields to the content type
set the layout for the content type as Modal
create a node of type Test Modal
save. It displays the modal button and clicking it opens the modal message.
Passstill puzzling
- Status changed to Postponed: needs info
over 1 year ago 11:38am 27 April 2023 - π¬π§United Kingdom nigelwhite Marsden
We still can't get a ui_pattern to save inside a layout_paragraphs container. Data can be entered in the pattern's fields but on Save the pattern vanishes. Go back into Edit and the pattern is gone.
Vanilla Drupal 9.5.8. The only modules present are ui_patterns, ds and layout_paragraphs + it's dependencies. ui_patterns and layout_paragraphs are both working on their own.
Error in logs
[error] 1895#1895: *871 FastCGI sent in stderr: "PHP message: Uncaught PHP Exception Twig\Error\LoaderError: "Template "modules/contrib/ui_patterns/templates/pattern-simpletext.html.twig" is not defined." at /var/www/html/web/modules/contrib/ds/templates/ds-entity-view.html.twig line 10" while reading response header from upstream, client: 172.24.0.6, server: , request: "POST /layout-paragraphs-builder/c141b322eb57d784c43020d991520c5a/choose-component?parent_uuid=c750c7c6-930f-4cbf-ac3a-830da4c3143e®ion=first&_wrapper_format=drupal_dialog&ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "d9-vanilla.ddev.site:89", referrer: "http://d9-vanilla.ddev.site:89/node/add/section_paragraph_ui_pattern" - π¬π§United Kingdom nigelwhite Marsden
In case anyone stumbles on this thread........
We're thinking it was our naming of yml / twig files that was causing it - whoops!