Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
   eZ Publish 4.x / legacy

eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

>= 5.4 / 2014.09


ez_field_name() is a Twig helper which returns a Content item's field FieldDefinition name in the current language.

This can be useful when you don't want to use sub request and custom controller to be able to display this information.

If the current language cannot be found as a translation for content, main language will be used. This behavior is identical when forcing a language using forcedLanguage.

Prototype and Arguments

ez_field_name( Content|ContentInfo content, string fieldDefIdentifier[, string forcedLanguage)

Argument nameTypeDescription
contenteZ\Publish\Core\Repository\Values\Content\Content or
Content / ContentInfo object the fieldDefIdentifier belongs to.
fieldDefIdentifierstringIdentifier of the field we want to get the FieldDefinition name from.
forcedLanguagestringLanguage we want to force (e.g. "jpn-JP"), otherwise takes prioritized languages from SiteAccess settings.