Issue
- When using custom field values, it has been observed that the preview is not available in the Staging Site. The custom field values are only present after publishing the page to Live.
Environment
- DXP 7.4
Resolution
- This behavior is due to the fact that expando values are not staged. There is a workaround that will produce the site's custom field values in the Staging Site. The custom template code will need to be altered to:
<#assign group = themeDisplay.getScopeGroup() /> <#if group.isStagingGroup() > <#assign group = group.getLiveGroup() /> </#if> Custom field value - ${group.getExpandoBridge().getAttribute('doc key')}
- Control Panel > Configuration > Custom Fields > Site > Plus Sign > Input Field > "Doc Key"
- Control Panel > Sites > Plus Sign > Blank Site > "Sample Site"
- Your Site > Configuration > Site Settings > Search for "Custom Fields" > Doc Key > Write "sample" in empty field below "Doc Key"
- Your Site > Publishing > Staging > Local Live
-
Your Site > Content and Data > Web Content > Template > Plus Sign > Input custom template code
<#assign group = themeDisplay.getScopeGroup() /> <#if group.isStagingGroup() > <#assign group = group.getLiveGroup() /> </#if> Custom field value - ${group.getExpandoBridge().getAttribute('doc key')}
Additional Information
- A Feature Request has been created for this issue, LPE-17796.
Conteúdo Excluesivo para Assinantes
Uma Subscrição do Liferay Enterprise fornece acesso a mais de 1.500 artigos que incluem práticas recomendadas, solução de problemas e outras soluções valiosas. Faça login para obter acesso completo.
Entrar