-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DS-767 Remove usage of image component from card #2520
Changes from 10 commits
05dacf0
bb57ac8
aa68e8b
189a139
61c9b8c
6654b46
ca7082c
7fb40ad
4c4c501
083912a
348368c
3e530b8
56631e0
9e9619d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,24 +13,59 @@ | |
}{% endverbatim %} | ||
{% endset %} | ||
|
||
{% set image_element_usage %}{% verbatim %} | ||
{% set image %} | ||
{% include '@bolt-elements-image/image.twig' with { | ||
background: true, | ||
attributes: { | ||
alt: 'Image alt text', | ||
src: 'path/image.jpg', | ||
}, | ||
} only %} | ||
{% endset %} | ||
{% include '@bolt-components-card-replacement/card-replacement.twig' with { | ||
horizontal: true, | ||
height: 'auto', | ||
media: { | ||
image: image, | ||
}, | ||
... | ||
} only %} | ||
{% endverbatim %} | ||
{% endset %} | ||
|
||
{% set customBodyDemo %}{% verbatim %}body: { | ||
content: customContentWithGrid, | ||
}{% endverbatim %} | ||
{% endset %} | ||
|
||
{% set image %} | ||
{% include '@bolt-elements-image/image.twig' with { | ||
background: true, | ||
attributes: { | ||
alt: 'Image alt text', | ||
src: '/images/placeholders/landscape-16x9-mountains.jpg', | ||
}, | ||
} only %} | ||
{% endset %} | ||
|
||
{% set card %} | ||
<bolt-text headline> | ||
Default horizontal card | ||
</bolt-text> | ||
<bolt-text> | ||
When using background element set <code>background: true</code>. This will crop the image in the horizontal card. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Helper text here is just what we need, but I'm not sure I understand from the sentence how it's supposed to work. There isn't a background element here 🤔 . Isn't it essentially just the following?
Feel free to tweak the wording, but I think the really important thing to get across is that users need to set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Today when I read this sentence, I didn't understand it either 😁 I updated the docs with your more specific description, only added one more detail that the horizontal card also must have the prop |
||
</bolt-text> | ||
{% include '@bolt-components-code-snippet/code-snippet.twig' with { | ||
content: image_element_usage, | ||
lang: 'twig', | ||
mode: 'dark', | ||
} only %} | ||
{% include '@bolt-components-card-replacement/card-replacement.twig' with { | ||
horizontal: true, | ||
height: 'auto', | ||
media: { | ||
image: { | ||
src: '/images/placeholders/landscape-16x9-mountains.jpg', | ||
alt: 'Image alt.', | ||
placeholder_color: '#afcde6', | ||
}, | ||
image: image | ||
}, | ||
body: { | ||
eyebrow: 'This is an eyebrow', | ||
|
@@ -78,11 +113,7 @@ | |
horizontal: true, | ||
height: 'auto', | ||
media: { | ||
image: { | ||
src: '/images/placeholders/landscape-16x9-mountains.jpg', | ||
alt: 'Image alt.', | ||
placeholder_color: '#afcde6', | ||
}, | ||
image: image, | ||
attributes: { | ||
style: 'min-width:' ~ width, | ||
} | ||
|
@@ -196,4 +227,4 @@ | |
} only %} | ||
</bolt-grid-item> | ||
{% endfor %} | ||
</bolt-grid>> | ||
</bolt-grid> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you didn't replace the image structured data array here with a rendered image, such that this looks like the following?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated