Provide a View All Button for Search Results

To Create a View All Button for Search Results:

  1. Create the resource messages for the View All link.

    To the pagingcomponents.properties file, add a pagecomponents.paging.viewall=View All resource message.

  2. In the pt_global.css, add a .pagination li.viewall style. This can be the same as the .pagination li.nextpage style.
  3. In the Search pipeline, click the Paging (bc_api) pipelet and change the value of the PageSize property to CurrentHttpParameterMap.sz.intValue. This causes the pipelet to derive the value of the paging size from the value passed into the pipeline if it's present. The name of the property is set by the PagingModel class AppendPaging method.
  4. To the pagingbar.isml file, you need to add the following in the first <sscript>in the file:
    if (pdict.pagingmodel.pageSize == null ){ 
    	pageSize = 9;
    }else { 
    	pageSize = pdict.pagingmodel.pageSize;
    }
  5. After the next page control, add:
    <isif condition="${totalCount > pageSize}">  
    <isscript>dict.pagingmodel.setPageSize(totalCount); </isscript>
    <li><a href="${pdict.pagingmodel.appendPaging( pageURL, 0)}">
    ${Resource.msg('pagecomponents.paging.viewall','pagecomponents',null)}</a>
    </li>
    <isscript>pdict.pagingmodel.setPageSize(pageSize); </isscript>
    </isif>
Note: When you have made this change, you can't change the default paging size directly from the pipeline. Instead, you have to change the pageSize = 9 line in the pagingbar.isml file to the desired value.