Attributs prop type source replaces token

Created on 27 December 2024, 5 months ago

Problem/Motivation

Hi,

I think it would be nice that in ui_patterns/src/Plugin/UiPatterns/Source/AttributesWidget.php a token could be used, for example to create a button with a title attribute with [node:title].

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

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

Merge Requests

Comments & Activities

  • Issue created by @Grimreaper
  • 🇯🇴Jordan Rajab Natshah Jordan

    This would be so nice. Thanks a lot for filing the issue.

    I faced an issue with Read more link or Learn more link in a call to action button
    My current status is

    The optimal target to work with aria-label="[node:field_link:text] about [node:title]" target="_parent"

    A common accessibility challenge arises when multiple identical links (e.g., "Read Article") appear on a page. Without additional context, screen reader users may struggle to distinguish between links. ARIA attributes, such as aria-label, allow developers to add meaningful descriptions to links, ensuring clarity and context.

    Helpful resource: What the Heck is ARIA A Beginner's Guide to ARIA for Accessibility - Kat Shaw (A11yTalks - Aug 2024)

    Thanks to A11yTalks and Kat Shaw for this

    Enhancing "Read Article" Links for Accessibility
    Replace generic "Read Article" links with meaningful ARIA labels:
    <a aria-label="Read the full article of {{ title }}">Read Article</a>

    If the link text changes to "Learn more", "Read more", or "Click here", the {{ title }} token will still help maintain context for screen reader users.

  • 🇯🇴Jordan Rajab Natshah Jordan

    First Draft MR - Integration with the Token module

  • Pipeline finished with Failed
    23 days ago
    Total: 478s
    #498302
  • 🇯🇴Jordan Rajab Natshah Jordan

    Tested with

    aria-label="[node:field_link:title] about [node:title]" target="_parent"
    
  • Pipeline finished with Failed
    23 days ago
    Total: 606s
    #498308
  • Pipeline finished with Failed
    23 days ago
    Total: 788s
    #498419
  • Pipeline finished with Failed
    23 days ago
    Total: 526s
    #498431
  • Pipeline finished with Failed
    23 days ago
    Total: 772s
    #498441
  • Pipeline finished with Failed
    23 days ago
    Total: 393s
    #498494
  • Pipeline finished with Failed
    23 days ago
    Total: 357s
    #498496
  • Pipeline finished with Success
    23 days ago
    Total: 728s
    #498500
  • 🇯🇴Jordan Rajab Natshah Jordan

    Attached a static ui_patterns--2025-05-16--3496209--mr-378.patch file to this point in MR378
    To be used with Composer Patches

  • 🇫🇷France pdureau Paris

    Hi Rajab,

    Thanks for the MR, it is very exciting.

    2 feedbacks:

    • Do we really need dependency to the contrib token module? Core Token API is not enough?
    • Can you add an automatic test with aria-label="[node:field_link:title] about [node:title]" target="_parent"?
  • 🇯🇴Jordan Rajab Natshah Jordan

    Thanks, Pierre, for the quick review.

    1- I will test that - you are right.
    2- For sure, we need

    • Automated unit testing coverage
    • Automated functional testing coverage
    • Documentation -- the doc in code is so nice by the way!!

    3- We may need to do a small UX/UI designer responsibilities - to help site builders so that they can use a token.

  • 🇫🇷France pdureau Paris

    Great plan!

  • Pipeline finished with Success
    17 days ago
    Total: 505s
    #503053
  • Pipeline finished with Canceled
    17 days ago
    Total: 405s
    #503092
  • Pipeline finished with Success
    17 days ago
    Total: 648s
    #503097
Production build 0.71.5 2024