legacy-knowledge-base
Publicado Jun. 25, 2030

Site's custom field value is not available in Staging Site

written-by

Adrienne Lao

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

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.

 

did-this-article-resolve-your-issue

legacy-knowledge-base