Forum

Thread tagged as: Question

select out more perch collections with perch_collection

Hi,

Maybe al looking in de wrong way, but i can't find it. Is it possible to use perch_collection for more than 1 collection. If yes how i can do that?

This is the code i use.

                <?php   
                     perch_collection('Datafeeds', [
                    'filter' => 'datafeedcontinent',
                    'match' => 'eq',
                    'value' => perch_pages_title(true),                 
                     'sort'  => '_date', 
                     'sort-order' => 'DESC',
                     'template' => 'datafeed_continent',
                     ]);
                ?>   

and i want that he use Datafeeds and Fox collection

                <?php   
                     perch_collection('Datafeeds''Fox', [
                    'filter' => 'datafeedcontinent',
                    'match' => 'eq',
                    'value' => perch_pages_title(true),                 
                     'sort'  => '_date', 
                     'sort-order' => 'DESC',
                     'template' => 'datafeed_continent',
                     ]);
                ?>   

I hope some can help me.

Thx

Fleur Besters

Fleur Besters 0 points

  • 3 years ago
Duncan Revell

Duncan Revell 78 points
Registered Developer

You just need to provide an array of collections, so:

perch_collection(['Datafeeds','Fox'], ...