Thread tagged as: Question, Runway

Relations in perch_collection() filters

I would (very much) like to access Runway relations in the perch_collection() page function's filters.

<perch:related id="projectRelatedAddress" collection="Addresses" label="Related Address"></perch:related>

"Give me all projects with size 1 or who have some relation entered in the "Related Address" Field. And sort them by the street in the related address".

I tried this:

   'template' => 'fe/project-teaser.html',
   // sort by a field of the relation
   'sort' => 'projectRelatedAddress.Street',
      // projects with size 1
      // and who have ANY kind of relation in the field "projectRelatedAddress"
     // this is what I tried

But something seems to be wrong. How do I write that correctly?

Urs Bräm

Urs Bräm 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd use projectRelatedAddress.projectSize

Brilliant! Thaaaanks!!!