Problem/Motivation
Following #3341066: [beta1]⚠️ Avoid manually injected HTML in footer component, we need to add the partners which are still missing from the footer pattern.
Example of markup:
<div class="fr-footer__partners">
<h4 class="fr-footer__partners-title">Nos partenaires</h4>
<div class="fr-footer__partners-logos">
<div class="fr-footer__partners-main">
<a class="fr-footer__partners-link" href="#">
<img class="fr-footer__logo" style="height: 5.625rem" src="../../../example/img/placeholder.16x9.png" alt="[À MODIFIER - texte alternatif de l’image]" />
</a>
</div>
<div class="fr-footer__partners-sub">
<ul>
<li>
<a class="fr-footer__partners-link" href="#">
<img class="fr-footer__logo" style="height: 5.625rem" src="/example/img/placeholder.16x9.png" alt="[À MODIFIER - texte alternatif de l’image]" />
</a>
</li>
<li>
<a class="fr-footer__partners-link" href="#">
<img class="fr-footer__logo" style="height: 5.625rem" src="/example/img/placeholder.1x1.png" alt="[À MODIFIER - texte alternatif de l’image]" />
</a>
</li>
</ul>
</div>
</div>
</div>
Proposed resolution
We are proposing to add this as its own pattern:
footer_partners:
label: (Footer partners)
description: "To be embedded in the footer pattern. https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/pied-de-page/"
fields:
title:
label: Title
type: text
preview: Nos partenaires
main:
label: Main partner
type: render
sub:
label: Other partners
type: render
So, in footer.ui_patterns.yml we can call the preview:
partners:
type: render
label: Partners
description: "A partner pattern."
preview:
type: pattern_preview
id: footer_partners
Remaining tasks
The nesting of links and image may be tricky.
Issue fork ui_suite_dsfr-3341122
Show commands
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
pdureau commentedYou may need the new Links settings type introduced by https://www.drupal.org/project/ui_patterns_settings/releases/8.x-2.1
Comment #4
spryah commentedWe put this issue on hold because the DSFR maintainers have yet to release a fix that will allow developers to define a list of (sub) partners without having to define a main partner (it shouldn't be long now)
Comment #5
pdureau commentedOK :)
Comment #6
pdureau commentedLinks type is now available.
Comment #7
pdureau commented3 month later, it seems it is not done yet upstream: https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/pi...
Comment #8
pdureau commentedSome thoughts...
1. Do we still do a separate component considering #3417519: [beta6] ⚠️ Merge footer_top into footer component ?
2. It will not be easy to convert main & sub slots to "links" props because of the images.
3. So, instead or aside of
footer_partnerscomponent, we may need a newpartner_linkcomponent with one url prop and one "image" slot:Comment #9
pdureau commentedComment #10
musa.thomasComment #12
musa.thomasComment #13
musa.thomasComment #14
pdureau commentedComment #15
pdureau commentedWhy
footer_partner_linkis a component? Can we achieve this witout introducing this unexpected component?Comment #16
musa.thomas@pdureau sorry for the late answer,
"Why footer_partner_link is a component? Can we achieve this witout introducing this unexpected component?"
but th #8 u said :
"3. So, instead or aside of footer_partners component, we may need a new partner_link component with one url prop and one "image" slot:
{{ set attributes = url ? attributes.setAttribute("href", url) : attributes }}
{{ image|add_class(""fr-footer__logo")|set_attribute("style", "height: 5.625rem")
"
Did I misunderstood something ?
Comment #17
pdureau commentedComment #18
just_like_good_vibeswe need to finish this for 1.1.0
Comment #19
pdureau commentedOne year later, I am not that sure this must be it's own component instead of just an addition to the footer component.
Comment #20
just_like_good_vibeslast issue before 1.1.0-RC-1 tag.
i will post code to this one soon, unless someone wants to do it?
Comment #21
just_like_good_vibeswe postpone this one, some notes :
- we won't make a new component, but we will upgrade the footer component
- still not sure about how to model the input.
- in the docs the style prop is not a good news.
- probably we will model the input with arrays, the first element(s) of array(s) would be the main partner. we won't separate main and sub partners in input
- footer related classes have to be injected into a and img tags, so we won't allow slots, rather a prop-based solution