Allow users to enter a token for [content-type] in the "Previous"/"Next" text

Created on 5 April 2023, over 1 year ago
Updated 3 May 2023, over 1 year ago

Problem/Motivation

Currently users can choose what text appears in the "Previous"/"Next" links, but there isn't a token available to include the content type in this text. As a result there are currently two main patterns users would tend to follow:

  • Just "Previous" and "Next". This poses an accessibility issue because the link text isn't understandable without visual context.
  • "Previous article" and "Next article". But this isn't accurate since it should really be "Previous article of this content type"

Proposed resolution

  1. Allow users to enter [content-type] as a token in the "Previous"/"Next" text fields, and add a description to the fieldset saying the token is available.

  2. In addition, "Previous"/"Next" text fields could be added for each content type to override the global setting. So if there's a certain content type name that users want to display differently in the "Previous"/"Next" field they can do so.

Using a token (as opposed to an "Append content type to text" checkbox) would allow for variation based on language - for instance, French users could enter "[content-type] suivant", and I can imagine there's languages where the token would go in the middle of the phrase.

(currently working on MR)

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024