Closed (fixed)
Project:
radix
Version:
6.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 May 2025 at 09:09 UTC
Updated:
8 Dec 2025 at 08:48 UTC
Jump to comment: Most recent
When card_image_overlays is set to true card_media is never used.
Add this:
{% include 'radix:card' with {
card_media: content.field_coverimage.0 ? content.field_coverimage|field_value : '',
card_title: label,
title_link: url,
card_subtitle: content.field_subtitle.0 ? content.field_subtitle|field_value : '',
card_body: card_body_rendered is real_content ? card_body_rendered : '',
card_image_overlays: true,
} %}
Instead this:
{% if card_image_overlays %}
{%
include 'radix:image' with {
src: card_image_src,
image_utility_classes: card_image_classes|merge(['card-img'])
}
%}
{%
set card_body_classes = [
'card-img-overlay'
]
%}
{% endif %}
Print card_media with the same conditions as used for slot_card_image_top and slot_card_image_bottom:
{% if card_image_overlays %}
{% if card_media|render %}
{{ card_media }}
{% elseif card_image_src %}
{%
include 'radix:image' with {
src: card_image_src,
image_utility_classes: card_image_classes|merge(['card-img'])
}
%}
{%
set card_body_classes = [
'card-img-overlay'
]
%}
{% endif %}
{% endif %}
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
thomas.frobieterOkay, done, but it is a problem to add the required 'card-img' class on the image within card_media? :/
However, it makes card_media work with the card image overlay.
Comment #5
doxigo commentedremoved - wrong thread
Comment #6
doxigo commentedComment #7
doxigo commentedComment #9
doxigo commentedThanks a lot, Thomas. This is fixed for now, regarding the
card-imgclass, not sure if this is straightforward since a media can also be, let's say, a video and so on. I think if it comes to it, we can either override the card component or maybe some sort of a custom hook that can detect the media within the card to add the classComment #13
anybody@doxigo could you maybe tag a new release with this fix? Eventually after merging #3561424: radix:navbar SDC: navbar_container_utility_classes should be type array not string?