Closed (fixed)
Project:
Name Field
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2019 at 13:07 UTC
Updated:
18 Jun 2026 at 21:50 UTC
Jump to comment: Most recent
Comments
Comment #2
bluegeek9 commentedThe closest you can get today is calling name.formatter yourself:
filteredArray() (line 163 of NameItem.php) already returns only the components that are active for that field, so it's the right source. But you need to reach out to the service manually.
Twig
Templates like name-item.html.twig expose a pre-rendered formatted_name variable built during template_preprocess_name_item(), but that uses a fixed format chosen by the field formatter display settings. You can't ask for 'full' vs 'short' at template time. There is no Twig extension at all.
I am marking the issue as postponed because adding a new method should be done in a major release.
Comment #3
bluegeek9 commentedAn issue to add a twig extension exists. #3553196: Add Twig filter to format name fields using NameFormatterInterface
Comment #4
bluegeek9 commentedComment #5
bluegeek9 commentedComment #7
bluegeek9 commentedComment #10
bluegeek9 commented