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_content_name() is a Twig helper which allows displaying a Content item's name in the current language.

If the current language cannot be found as a translation for content, the name in the 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

 

Equivalent PHP code

Getting the translated name for a Content item
Forcing a specific language

 

  • No labels