Customizing pagination delta values at instance/site level
written-by
Daniel Carrillo Broeder
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
- The pagination options for search results (e.g., the number of items displayed per page) are controlled globally by the
search.container.page.delta.values property in the portal-ext.properties file.
- Since this configuration affects the whole environment, Is there any alternative or out-of-the-box option available?
Environment
- Liferay DXP and Quarterly Releases.
Resolution
- The pagination delta values are configured in the properties, and there is no alternative without customization.
- The recommended approach is to create a custom Widget Template for the Search Results widget with your custom pagination
- This allows for building a custom paginator without modifying core JSPs.
- You can use the
searchContainer FreeMarker variable to access pagination data like the total number of results and the current page.
- Your custom paginator should generate URLs that modify the URL parameters to control the display:
-
delta: Sets the number of items per page.
-
start: Sets the starting index for the results on the current page.
- Under the Search Results > Display Settings tab, uncheck the option Show Default Pagination to hide the default paginator and prevent duplicates.
- Alternativelly, You can try to add custom JavaScript to the page or theme to modify the HTML of the default pagination selector after it has loaded.
- Overriding the JSP file is another option. However, this approach requires more maintenance during future Liferay DXP updates and is generally not recommended.
did-this-article-resolve-your-issue