Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   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

Version compatibility

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

  • Using a Field as fieldDefIdentifier argument as of eZ Publish 5.3 / 2014.03

Description

ez_is_field_empty() is a Twig helper which checks if a Content item's field value is considered empty, in the current language.

It returns a boolean value (true or false).

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_is_field_empty( eZ\Publish\Core\Repository\Values\Content\Content content, eZ\Publish\API\Repository\Values\Content\Field|string fieldDefIdentifier[, string forcedLanguage)

Argument nameTypeDescription
contenteZ\Publish\Core\Repository\Values\Content\ContentContent object the displayable field belongs to.
fieldDefIdentifiereZ\Publish\API\Repository\Values\Content\Field or string
The field we want to check or its identifier.
forcedLanguagestringLocale we want the content name translation in (e.g. "fre-FR"). Null by default (takes current locale)

Usage

Using the field identifier as parameter

Using the Field as parameter