Jump to content
entschleunigung

Selector with exception

Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites
$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

Share this post


Link to post
Share on other sites

You could try

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

 

  • Like 1

Share this post


Link to post
Share on other sites

If any of the alternatives work I'd still wonder why his original code wouldn't work. 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...