Legacy Knowledge Base
Published Jun. 30, 2025

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

Written By

Adrienne Lao

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

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