- Issue created by @pdureau
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
I remember why it has been splitted.
In a card you can place stuff not in card-body div:
- https://getbootstrap.com/docs/5.3/components/card/#list-groups
- https://getbootstrap.com/docs/5.3/components/card/#kitchen-sinkAlso it seems that card has some new features since, not implemented: https://getbootstrap.com/docs/5.3/components/card/#image-overlays
- 🇫🇷France pdureau Paris
Proposal, in order to be able to handle non-body and additional stuff.
Split
content
slot betweencontent_before
andcontent_after
In Card template, replace
{{ content }}
by:{{ content_before }} <div class='card-body"> {% if title %} <h{{ heading_level }} class="card-title">{{ title }}</h{{ heading_level }}> {% endif %} {% if subtitle %} <h{{ heading_level + 1 }} class="card-subtitle">{{ subtitle }}</h{{ heading_level + 1 }}> {% endif %} {% if text %} <p class="card-text">{{ text }}</p> {% endif %} {{ content }} {{ links|add_class('card-link') }} </div> {{ content_after }}
This change will be breaking.
- Assigned to Grimreaper
- Assigned to pdureau
- 🇫🇷France Grimreaper France 🇫🇷
Sorry to go back on our discussion.
But in https://getbootstrap.com/docs/5.3/components/card/#kitchen-sink, we can see that a card can have multiple card-body. I think that's why the "content before"/"content after" had not been chosen previously.
- Assigned to Grimreaper
- 🇫🇷France Grimreaper France 🇫🇷
As discussed. Let's keep card body as it is and document in the description why it exists.
Also implement missing features.
- Merge request !170Issue #3427151 by Grimreaper, pdureau: Document why card body. Implements card overlay. → (Merged) created by Grimreaper
- Assigned to pdureau
- Status changed to Needs review
8 months ago 10:44am 28 March 2024 - Assigned to Grimreaper
- Status changed to Needs work
8 months ago 10:54am 30 March 2024 - 🇫🇷France pdureau Paris
1. Create an other issue about card overlay.
2. Proposal for description:
description: "Internal: to be used in the 'Card' component. Isolated because a card can have multiple 'Card body' components."
- Issue was unassigned.
- Status changed to Fixed
8 months ago 11:36am 30 March 2024 -
Grimreaper →
committed 8633c4d2 on 5.0.x
Issue #3427151 by Grimreaper, pdureau: Document why card_body exists
-
Grimreaper →
committed 8633c4d2 on 5.0.x
Automatically closed - issue fixed for 2 weeks with no activity.