General

  eZ Systems Website
  Editor documentation


  Developer documentation

  Back to the top

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Description

ez_field_value() is a Twig helper which returns a Content item'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, the main language will be used. This behavior is identical when forcing a language using forcedLanguage.

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 field referred to with fieldDefIdentifier 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