Created
August 29, 2022 08:04
-
-
Save pedroblandim/3f603cd5675b412d1e8accfeac182264 to your computer and use it in GitHub Desktop.
LIFERAY: Get localized custom field value on widget template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#function getLocalizedCustomFieldValue navItem customFieldName> | |
<#assign customField = navItem.getLayout().getExpandoBridge().getAttribute(customFieldName)> | |
<#if customField??> | |
<#list customField?keys as key> | |
<#if key == locale> | |
<#return customField?values[key_index]!"" /> | |
</#if> | |
</#list> | |
<#else> | |
<#return "" /> | |
</#if> | |
</#function> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment