Jump to content

Selector with two fields using OR operator fails


efiguerola
 Share

Recommended Posts

I have the following selector:

wire("pages")->find("template=news|video, parent|secondary_categories=$page, limit=8, sort=-publish_date, sort=title");

parent represents the parent of the current page

$page is the object representing the current page

secondary_categories is a field assigned to the "news" and "video" templates, it is of type "Page" and it uses ASMSelect for selecting multiple pages

So basically, what I'm telling ProcessWire is:

"Get me 8 pages that use either the 'news' OR 'video' template, AND that also have the current $page as their parent OR that have a reference to the current $page within their secondary_categories field".

The problematic part is:

parent|secondary_categories=$page

The OR operator is not working - I'm only getting pages where the parent is $page, and none where $page is in secondary_categories.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...