joachim_nissler
Returning Observer

Getting all languages from a data source entry

HI community,

I'm trying to get all translations for a datasource entry within a section template.

The list of all relevant languages is defined as "st_languages" as ("de", "en", ...).

"allItems" is the result of the CMS_HEADER Query.

Does the code below meet the best practises or is there any better solution for doing this?

 

$CMS_FOR(item, allItems)$
	    <item FSID="$CMS_VALUE(item.fs_id)$">			
		$CMS_FOR(lang,st_languages)$
			<label language="$CMS_VALUE(lang)$"><![CDATA[$CMS_VALUE(item.getValue("tt_name_" + lang.toUpperCase()))$]]></label>
		$CMS_END_FOR$
	    </item>
	  $CMS_END_FOR$ 

 

Cheers,
Jo

0 Kudos