Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PW search
$words = '';
$q = $sanitizer->selectorValue($input->post->q);
$words = explode(' ', $q);
foreach($words as $word) {
$word = $sanitizer->selectorValue($word);
if($word) $selectorEmergencyContacts .= "title|label_$lang*=$word, ";
// search for Emergency Contact Addresses, match pages that have this address in "emergency_address_select" page field (in two lines!!!)
$address_matches = $pages->get(1458)->find( $selectorEmergencyContacts . " template=emergency-contact, include=hidden");
if(count($address_matches) > 0) {
// if we found Contacts, we search for objects having this address added through page reference field "address_select"
$matchesA = $pages->get(1010)->find("emergency_address_select=$address_matches, template=object");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.