Allow to use parent entity Label as the link text instead of the fixed link text

Created on 7 January 2022, almost 3 years ago
Updated 7 November 2023, about 1 year ago

Problem/Motivation

Would it be possible to allow to use parent entity Label as the link text instead of the fixed link text?

Proposed resolution

  1. Add setting override_label to settingsForm
  2. Get parent entity label ($label = $items->getEntity()->label();) in the viewElements function
  3. In viewElements function, if override_label is enabled then set item 'title' to $label
  4. In the test that checks the title override set 'override_label' => FALSE.
  5. Add test Tests that the link is formatted with the configured parent entity Label option.

Remaining tasks

Add test Tests that the link is formatted with the configured parent entity Label option.

User interface changes

Add setting 'Override text using parent entity Label'.

Data model changes

Add setting override_label to fixed_text_link_formatter.schema.yml and settingsForm.

✨ Feature request
Status

Postponed: needs info

Version

1.6

Component

Code

Created by

πŸ‡ΈπŸ‡¦Saudi Arabia martins.bruvelis Thuwal

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    I don't understand what this feature request has to do with the scope of this module. πŸ˜… Seems to run counter to what a "fixed text link formatter" would provide. Why should this functionality live here?

    Thanks,
    -Derek

Production build 0.71.5 2024