[1.1.0] Correct share component

Created on 24 March 2025, 9 days ago

Problem/Motivation

Attributes of links and how to have the right js code

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇫🇷France just_like_good_vibes PARIS

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

Comments & Activities

  • Issue created by @just_like_good_vibes
  • 🇫🇷France hproustacx

    First issue :
    in web/themes/contrib/ui_suite_dsfr/components/share/share.twig Line 6 should be

    {% set link_attributes = link.link_attributes|default({}) %}
    

    to allow attribute from menu or other entities

    Second issue :
    There is no way to properly contribue that component in Drupal, you either have to do some custom entities, or rework the links in Javascript
    Possible solution would be to contribute that component as a menu and use token in the url field to respect the pattern of the DSFR example :
    https://www.facebook.com/sharer.php?u=[ insert current page url]

Production build 0.71.5 2024