Open laurencefass opened 5 years ago
ui_patterns.yml looks like this:
slidecard:
label: 'Card'
description: 'A slide-card component.'
fields:
image:
label: 'Image'
description: 'A simple image with caption.'
fields:
image:
type: 'image'
label: 'Image'
description: 'background image'
preview:
theme: 'image'
uri: 'http://site/sites/default/files/2019-01/tech%20type%20font%20idea_1.png'
title:
type: 'text'
label: 'Title'
description: 'Set card title.'
preview: 'Card title'
position:
type: 'text'
label: 'Position'
description: 'Set overlay entrance position (top, bottom, left, right, fade)'
preview: 'left'
text:
type: 'text'
label: 'Text'
description: 'Card text.'
preview: 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'
``
pattern-slidecard.html.twig like this:
title = {{ title }} text = {{ text }} position = {{ position }} image = {{ image }}
Have you tried removing your single quotes? AFAIK the 'type' is simply used for documentation right now, so it's probably to do with your yml structure. There's definitely no single quotes in any of the examples.
The indentation of your ui_patterns.yml file seems to suggest that you have two patterns: slidecard
and image
, do you have the related twig template for both of them?
original issue: https://github.com/nuvoleweb/ui_patterns/issues/175
I raised issue nearly a year ago with error on images. the reply suggested i read the documentation which is not helpful in this case. i have only installed and tried to use the module and made no code modifications. The documentation and it doesnt say a lot about images or plugins.
i am again trying to create a basic card (see comments below for yml and twig) with an image and i am seeing the following error:
and watchdog message: