Navigation
eZ Documentation Center
 

This is outdated documentation made for eZ Publish Platform 5.2. It is being moved into the eZ Publish 5.x documentation, so please go there for most up-to-date documentation.

Skip to end of metadata
Go to start of metadata

Version compatibility

This Twig helper is available as of eZ Publish 5.2 / 2013.09

Description

ez_field_value() is a Twig helper which returns Content's field value in the current language.

This can be useful when you don't want to use ez_render_field and manage the rendering by yourself.

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.

Prototype and Arguments

ez_field_value( eZ\Publish\Core\Repository\Values\Content\Content content, string fieldDefIdentifier[, string forcedLanguage)

Argument nameTypeDescription
contenteZ\Publish\Core\Repository\Values\Content\ContentContent object the displayable field belongs to.
fieldDefIdentifierstringIdentifier of the field we want to get the value from.
forcedLanguagestringLocale we want the content name translation in (e.g. "fre-FR"). Null by default (takes current locale)

Usage

 

 

 

 

  • No labels