- Issue created by @pdureau
- 🇫🇷France just_like_good_vibes PARIS
let's keep the current implementation intact about "unfolding" render arrays.
let's take this decision, Pierre? - Issue was unassigned.
- Status changed to Postponed
4 months ago 3:56pm 23 January 2025 Hi. Do you have some custom solution for that sort of cases ? Because we were struggling with this problem and we eventually came up with the idea to use an extra field (which I did not find great, it was for the pattern Tag Group - from UI Suite DSFR, we had multiple Taxonomy fields with multiple cardinality)
- 🇫🇷France pdureau Paris
Hi Lus,
Thanks for using UI Patterns 2. Can you tell us how is it an issue for you? What is the technical problem you meet?
Sure. Will use a real life example coming from UI Suite DSFR.
For the context, we have used UI Patterns: 1.10.0, UI Suite DSFR: 1.0.1,We've used a pattern "Tag Group" with this html structure:
{% if tags %} {% set tags = tags is sequence ? tags : [tags] %} <ul{{ attributes.addClass('fr-tags-group') }}> {% for tag in tags %} <li>{{ tag }}</li> {% endfor %} </ul> {% endif %}
In the BO, we've created a Field group which used this pattern, inside it, we've added two fields (sources) of type entity ref. Taxonomy term, with a multiple cardinality, each one uses a pattern "Tag":
(hope u can see the details)
Then, inside the content, for both field, we've added 3 values. But the end result was that we got a single "- " inside which were all the 6 terms (wrapped with the HTML of the "Tag" pattern), instead of having 6x "
- ".
Feel free to ask for further clarification if it's not clear.
- Status changed to Active
12 days ago 9:17am 22 May 2025 - 🇫🇷France pdureau Paris
Hi @lus just a side note while waiting for the expected answer:
{% set tags = tags and tags is not sequence ? [tags] : tags %}
is better/safer than{% set tags = tags is sequence ? tags : [tags] %}
- 🇫🇷France just_like_good_vibes PARIS
hello,
after a small discussion, it appears the needs should be addressed with a custom source, that would make the data extraction as needed and return the appropriate data