Message-ID: <1448779538.2910.1485851211967.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2909_2026488242.1485851211967" ------=_Part_2909_2026488242.1485851211967 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html ez_trans_prop

ez_trans_prop

=20 =20

>=3D 5.4= / 2014.09

Description

ez_trans_prop() is a generic, low level Twig helper which c= orrect translated value of a multi valued(translations) property. 

If the current language cannot be found as a translation for content, main = language (see=20 further down for d= etails) will be used if this is supported by provided=20 object. This behavior is identical when  forcing a language using  forcedLanguage.

Prototype and Arguments

ez_trans_prop( ValueObject obje= ct, string property[, string forcedL= anguage)

Argument name Type Description
object eZ\Publish\Core\Repository\V= alues\ValueObject ValueObject object property belongs to.
property string Property to get translated value f= rom, logic is using one of the following (in this order):
  • property  "{property}s"
  • method "get{property}" 
forcedLanguage string Language we want to force (e.g. "<= code>eng-US"), otherwise takes prioritized languages from SiteAccess= settings.

Main language use

Main language is attempted to be applied in the following way for V= alue objects that support this:

Usage

Example below shows how this function can be used to get the Content nam= e with exact same result as using ez_content_name(content)

=20
<span>{{ ez_trans_prop( versionInfo, "name" ) }}</spa=
n>
=20

 

 

------=_Part_2909_2026488242.1485851211967--