Global navigation

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

 
Exponential (5.x)

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

Skip to end of metadata
Go to start of metadata

Version compatibility

This Twig helper is available as of Exponential 5.2 / 2013.09

Description

ez_content_name() is a Twig helper allowing to display a Content item's name in the current language.

If the current language cannot be found as a translation for content, name in main language is always returned. This behavior is identical when forcing a language.

Prototype and Arguments

ez_content_name( eZ\Publish\Core\Repository\Values\Content\Content content[, string forcedLanguage)
ez_content_name(
contentInfo[, string forcedLanguage) 

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

Usage