Jump to content
Sign in to follow this  

Search pages for value contained in a pages field?

Recommended Posts

I've created a template for physicians. The template has several fields:




specialty (Page Field)

associated_clinics (Page Field)


I need to build a search query against the physicians pages, using their specialty and associated_clinics values.

But I can't seem to figure out how to write a selector for this purpose.


Can anyone lend some insight?

Share this post

Link to post
Share on other sites

It depends on what you have. If you have the specialty as a string, you can select for the page’s title field like so:

$pages->find('template=physician, specialty.title={$search}');

If you know the specialty’s page-id or path, that should work as well. For example on a specialty page, you would want to list all physicians that have that specialty:

$pages->find('template=physician, specialty={$page->id}');
  • Like 3

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...