Jump to content

Recommended Posts

Posted

hello,

is there a possibility to define exceptions in a selector?

this is my selector:

$selector = "template=expertsItem, location=$location, department=$department, sort=expertSurname";

i would like this selector to give me everything from $ department but not the department with id 2131, for example. 

i have tried the following, unfortunately without success

$selector = "template=expertsItem, location=$location, department=$department, department!=2131, sort=expertSurname";

do you have any idea for me how to solve this?

 

thank you

 

 

Posted
$selector = "template=expertsItem, location=$location, department=$department, id!=2131, sort=expertSurname";

?

or if you're trying to exlude the page you're on, you can use id!=page.id

  • Like 1
Posted

You could try

$matches = $pages->find("template=expertsItem, location=$location, department=$department, sort=expertSurname")->not("department=2131");

 

  • Like 1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...