Consolidate card pattern templates

Created on 3 March 2023, almost 2 years ago
Updated 4 March 2023, almost 2 years ago

Problem/Motivation

For both the 4.x & the 5.x branch.

A set of good practices are meregrign for UI suite themes and one of them is:

  • Inject children components to slots from the outside context isntead of hardcoding them in the template
  • If you have no choice but hardcoding a child component, use the pattern() function whcih is safer (no conetxt passing)

And UI Suite Bootstrap is now used as a example of a complete, powerful and clean impelmenattions of UI Suite.

However, we still have 6 uses of include() functions in our templates:

Proposed resolution

The inclusion doesn't do much, it just add this:

{% if header %}
<div class="card-header">
  {{ header }}
</div>
{% endif %}

{{ content }}

{% if footer %}
<div class="card-footer">
  {{ footer }}
</div>
{% endif %}

So copy paste those 11 simple lines where the include is in the templates.

Remaining tasks

Propose a MR for 5.x. Auto-merge 4.x/

User interface changes

No, it is safe

API changes

No, it is safe

Data model changes

No, it is safe

📌 Task
Status

Fixed

Version

5.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024