paging in search results

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

paging in search results

Postby winters » Wed Jan 27, 2016 5:54 pm

hi all,

I would like to use the code underneath in the search results.

A I like to use paging with this

Code: Select all
[[foreach amount=12 from=$searchresults item=result]]

 <h2><a href="[[ link hrefonly=1 ]]">[[ title ]]</a></h2>
            <h3>[[ subtitle ]]</h3>

[[/foreach]]
        <center>
               [[ paging action='prev' amount=12  ]] |
                    [[ paging action='next' amount=12  ]]   </center>


amount =12 has no influence

does someone know what the correct code should be

thanks!
bc
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: paging in search results

Postby Harm10 » Thu Jan 28, 2016 8:50 am

I am fairly sure the paging template will not work on this. Paging searches for the active (sub)weblog and works on that. If it finds something that surely will not be the search results.

And if you want to limit the amount of results you need to stop the foreach loop yourself. This is a standard smarty template: http://www.smarty.net/docsv2/en/language.function.foreach.tpl Look at the index or iteration description to see how to work with that.

Edit: maybe you can try to use the standard section template? http://www.smarty.net/docsv2/en/language.function.section.tpl That has a max parm to limit the loop.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: paging in search results

Postby winters » Fri Jan 29, 2016 1:50 am

you are the best harm, for the time being I will use

[[if $smarty.foreach.list.index == 12]]
[[php]]break;[[/php]]
[[/if]]

thanks
again
bc
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm


Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 2 guests

cron