Follow default_value defined in JSON schema into twig

Created on 13 February 2025, about 2 months ago

Problem/Motivation

See discussion on 🐛 Default props values are not used Active .

We should follow default_value logic from component definition in JSON schema, into twig.

For exampe, in tile, borders or icon props are default to true. But if i include a tile twig without defining those props, i expect the display will be as default values are defined in component schema.

Steps to reproduce

Include tile pattern in a twig file like

{{ include('ui_suite_dsfr:tile', {
    variant: 'horizontal',
    image : content.field_icon ,
    title : content.title,
    icon: paragraph.field_tile_display_icon.value
}, with_context = false) }}

Proposed resolution

Use |default or another conditional twig solution like is defined to reproduce default values defined in component schema.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇫🇷France goz

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024