Legacy Knowledge Base
Published Jul. 2, 2025

Search result redirects to wrong page when there are multiple pages configured with Document and Media Portlet

Written By

Anishq Sharma

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

Search result redirects to wrong page when there are multiple pages with Document and Media Portlet configured for showing individual folders.

  • Steps to reproduce:
    1. Create three folders in Document and Media and add some files to each of them.
    2. Create three pages on the site.
    3. Add Document and Media portlet to all three pages and configure one-one folder as root folder on each page.
    4. Search the file on site.
    5. Click on the file name in the search.
    Observed Behavior: The file opens on a different page than the one it is added on.
    Expected Behavior: The file opens on the same page as it is added on.

Environment

  • Liferay DXP 7.3

Resolution

  • Above Observed behavior is the expected behavior of Liferay portal.
  • Although Liferay portal has the possibility to Display Selected Results in Context, it doesn't guarantee the content (document) is displayed where user puts it originally.

Additional Information

  • Excerpt from Configuring the search result widget :

    Display Selected Result in Context: Show clicked assets in their native display widgets, if one is detected on a page in the same Site. For example, if you click on a blog post in the search results, you see the Blogs Entry in the Blogs application. You’re no longer in the search context after clicking on a search result.

    When this option is unchecked or an asset is not displayed on a page in the Site, the asset instead displays in an Asset Publisher window while still in the search page context. If you have the right permissions, you can even edit the content directly from the Search context. Click the back arrow to return to the search results.

 

Did this article resolve your issue ?

Legacy Knowledge Base