Skip to content

Instantly share code, notes, and snippets.

View MeryllEssig's full-sized avatar
🌸

Meryll Essig MeryllEssig

🌸
View GitHub Profile
@arfaram
arfaram / FieldValue_translation.md
Last active January 11, 2021 12:24
Get a current translated field data using different way in eZ Platform.

Assume we want to get the translated value of a Text Line (ezstring) field with identifier title.

Using content object

        $contentService = $this->get('ezpublish.api.service.content');
        $content = $contentService->loadContent('<CONTENT-ID>');
        $language = $content->versionInfo->initialLanguageCode;  
        $title = $content->fields['title'][$language]->text;
        //Or