We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    Revo 2.5.2
    SimpleSearch 1.9.2

    It seems that unlike the custom pagination I created with getPage/getResources/getResourcesTag, when there is only a single page of SS results the pagination still shows the page number, i.e. "1".

    So instead is there a way to (dynamically?) hide the page number (1) when there is only a single page of search results?
    [[!SimpleSearch?
        &elementClass=`modSnippet`
        &ids=`[[!getReqParam? &name=`parent`]]`
        &includeTVs=`1`
        &containerTpl=`Search Container`
        &tpl=`Search Result`
        &pageTpl=`Page`
        &pageNextTpl=`Page Next`
        &pageFirstTpl=`Page First`
        &pageLastTpl=`Page Last`
        &pagePrevTpl=`Page Previous`
        &perPage=`5`
        &pageLimit=``
        &pagingSeparator=``
        &exclude=`1`
        &highlightTag=`span`
        &highlightClass=`highlight`
    ]]
      Todd
      • 37105
      • 194 Posts
      You could use an output filter in the containerTpl chunk to hide the pagination string. So in the following example the string with pagination will be shown when the value of [[+paging]] is 1.

      <div class="sisea-paging"><span class="sisea-result-pages">[[%sisea.result_pages? &namespace=`sisea` &topic=`default`]]</span>[[+paging:is=`1`:then=`[[+paging]]`]]</div>


      When you want to hide the complete string with pagination just put output filter wrapped on the snippet call.

      [[+paging:is=`1`:then=`<div class="sisea-paging"><span class="sisea-result-pages">[[%sisea.result_pages? &namespace=`sisea` &topic=`default`]]</span>[[+paging]]</div>`]]
        Codeplaza Webdesign: for professional websites at low cost
        • 40088
        • 708 Posts
        @DonQuickly Great idea about the output modifier.

        Here's what worked for me:
        [[+pageCount:is=`1`:then=``:else=`[[+paging]]`]] 

        I don't know if this is the best or most elegant solution but it seems to work so far (still testing). [ed. note: todd.b last edited this post 7 years, 4 months ago.]
          Todd