Legacy Knowledge Base
Published Jun. 30, 2025

Web Content Not Displayed in Context in Search Results

Written By

Jose Bodega

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

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

Issue

  • Some web contents are not displayed in context when accessed from search results with the "Display selected search result in context" checkbox selected.
    • For web contents displayed in an asset publisher, the correct context is the page containing the asset publisher displaying the web content. For many web contents, clicking on them in the search results list leads to the correct context page. However, there are cases where, despite having a page with an asset publisher configured with that specific content, the search details do not lead to that page, but to an out-of-context view of the content.
    • The issue seems to affect web content migrated from 6.1 to DXP 7.3 and not web content created directly in DXP.

Environment

  • DXP 7.3

Resolution

  • Opening the web content in edit mode and canceling without making any changes resolves the issue.
  • Saving the web content asset publisher configuration without making any other changes also fixes the problem.

The issue occurs when web contents that have a defined in-context usage do not have references in the LAYOUTCLASSEDMODELUSAGE table. When the web content is opened in edit mode, even if changes are not saved, or when the asset publisher configuration is saved, the system executes code that checks for in-context usage in the journalcontentsearch table and adds the missing entries to the LAYOUTCLASSEDMODELUSAGE table.

Code Liferay 7.3

The relationship between the layoutclassedmodelusage and journalarticle tables is based on the fact that the classPK field in layoutclassedmodelusage can correspond to the resourcePrimKey in JournalArticle.

 

 

Did this article resolve your issue ?

Legacy Knowledge Base