Browser Back Button Requires Multiple Clicks on Pages with Multiple Asset Publishers
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 a page contains multiple Asset Publishers, clicking the back button multiple times may be required to return to the previous page.
Resolution
- This is intended behavior following the implementation of LPSA-67721.
- To make the back button return to the previous page in one click:
- For each Asset Publisher on the page, open the widget's Options menu > Configuration > Communication.
- In the
assetEntryId row under Shared Parameter, check Ignore. - Click Save.
Additional Information
- With the expected behavior, when you return from a viewed asset to the list, the Asset Publisher scrolls back to that asset instead of to the top of the list. To do this, the return URL carries the viewed asset's
AssetEntryId. AssetEntryId is a shared parameter, so every Asset Publisher on the page that doesn't ignore it receives the value. When the page loads, each publisher sets the value as the URL fragment (#<AssetEntryId>). Setting the fragment adds an entry to the browser history, so the first back click only removes the fragment and stays on the same page. When an Asset Publisher is configured to ignore AssetEntryId, it doesn't set this fragment. - As an important caveat, ignoring
AssetEntryId changes how that Asset Publisher behaves:- When you return from a viewed asset, the list opens at the top instead of at the asset you viewed.
- The Asset Publisher no longer responds to an asset selected in another widget on the page.
- If an asset's Asset Link Behavior is Show Full Content, clicking an asset other than web content or a blog entry shows an error instead of the asset. As such, it's recommended to keep
AssetEntryId enabled on Asset Publishers that display those assets.
did-this-article-resolve-your-issue