Add a Title Formatter

Created on 27 August 2024, 17 days ago
Updated 12 September 2024, 1 day ago

Problem/Motivation

Split out from Add formatters and other mechanisms as alternative to base fields directly in entity templates Active .

Steps to Add/select title formatter :

- Go to any entity like node: https://your_site_url/admin/structure/types/manage/article/fields

- Add plain text field(for eg Sub Title) from manage field tab of content type, then go to manage display of content type:
https://your_site_url/admin/structure/types/manage/article/display

- Here you find the newly added "Sub Title" field & next to it, there is "format column" display where you 'll see now "Title" option visible to select, along with it there is additional settings that you can configure by clicking "setting icon" that displaying next to it.

In additional setting there are two "format settings" are available :
- Link to the Content: if you enable the checkbox then this newly added field (For eg: Sub Title) content 'll be linked to it's node itself.
- Tag: In it, these options h1,h2,h3,h4,h5,h6,span,div are available to select, when this newly added field (For eg: Sub Title) content render then you 'll see selected tag 'll wrap the content on FE.

Proposed resolution

Create a TitleFormatter, copying code from Manage Display module. It should be fine with minimal changes.

Write a test.

Remaining tasks

Review
UX review
Screenshots

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Needs review

Version

11.0 🔥

Component
Field 

Last updated 1 day ago

Created by

🇬🇧United Kingdom AdamPS

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

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @AdamPS
  • First commit to issue fork.
  • Merge request !9341issue/3470497: Added title formatter. → (Open) created by pooja_sharma
  • Pipeline finished with Failed
    17 days ago
    Total: 225s
    #266208
  • Assigned to pooja_sharma
  • Added title formatter as mentioned in proposed solution , this 'll add title formatter for plain type field for manage display , working on test coverage part in which cover if title formatter selected for field type , then it linked to title or not.on the basis of selected config.

  • Pipeline finished with Success
    16 days ago
    Total: 772s
    #266931
  • Pipeline finished with Success
    16 days ago
    Total: 711s
    #267255
  • Pipeline finished with Success
    16 days ago
    Total: 540s
    #267269
  • Issue was unassigned.
  • Status changed to Needs review 16 days ago
  • Added title formatter as mentioned in proposed solution & added test coverage as well for title formatter, apart form nothing seems to be left.

    PLease review, moving NR

  • Pipeline finished with Failed
    16 days ago
    Total: 475s
    #267279
  • Status changed to Needs work 16 days ago
  • 🇺🇸United States smustgrave

    Saw this one early, left some comments.

  • Assigned to pooja_sharma
  • Pipeline finished with Success
    16 days ago
    Total: 473s
    #267295
  • Pipeline finished with Success
    15 days ago
    Total: 488s
    #267993
  • Issue was unassigned.
  • Status changed to Needs review 15 days ago
  • Addressed the feedback, left one comment on MR. PLease review, moving NR.

  • 🇺🇸United States smustgrave

    Responded to comment

  • Status changed to Needs work 15 days ago
  • 🇺🇸United States smustgrave

    Will also need change record.

  • Assigned to pooja_sharma
  • Thanks for reviewing. working on the feedback.

  • 🇳🇿New Zealand quietone New Zealand

    Nice to work on issues in the Modernization effort 🌱 [meta] Drupal modernization Active . Thanks!

    This is changing the UI so adding Usability tag. As a new form this should have a Usability review as well, so adding that tag. And screenshots available from the issue summary.

  • Pipeline finished with Failed
    14 days ago
    Total: 2241s
    #269196
  • Pipeline finished with Success
    14 days ago
    Total: 1253s
    #269230
  • Pipeline finished with Success
    11 days ago
    Total: 499s
    #271508
  • Issue was unassigned.
  • Status changed to Needs review 11 days ago
  • 🇺🇸United States smustgrave

    Code wise don't see anything but leave in review for usability

  • 🇺🇸United States mradcliffe USA

    Could a site builder end up creating a situation where they set the sub title to use h2 and then the hierarchy no longer matches between teaser and page views?

    - Page
    - h1: Node Title via page-title
    - h2: Sub title
    - Teaser
    - h1: Page title
    - h2: Node title
    - h2: Sub title

  • Could a site builder end up creating a situation where they set the sub title to use h2 and then the hierarchy no longer matches between teaser and page views?

    - Page
    - h1: Node Title via page-title
    - h2: Sub title (Default form mode)
    - Teaser
    - h1: Page title
    - h2: Node titlender
    - h2: Sub title or h3: Sub title (whatever selected in tag of title formatter in specific form mode like here teaser, 'll render on FE)

    Yes I have verified it is possible, correct me if I 'm missing anything.

  • I am not able to reproduce issue , not getting Title dropdown

    Steps to followed
    1. Added Plain text filed in Article.
    2. Configured in manage display , not getting title Drop down in Format column fort "Title".
    3. Adding screenshot for reference.

  • Status changed to Needs work 1 day ago
  • 🇫🇮Finland sokru

    +1 for adding this feature, so it would make easier to land the parent issue.
    Left suggestion also to add H6 -level element.

    I assume #18 was missing a cache clearance.

  • Pipeline finished with Canceled
    1 day ago
    Total: 67s
    #280986
  • Pipeline finished with Success
    1 day ago
    Total: 746s
    #280987
  • Status changed to RTBC 1 day ago
  • h6 tag by mistaken missed added back, Please review moving NR (usability review tag)

  • Status changed to Needs review 1 day ago
Production build 0.71.5 2024