Search the Community
Showing results for tags 'Filter results'.
-
OK, after three days of banging my head against this, I turn to the forums. I am attempting to apply what would seem to be a rather straightforward filter to a set of results, but am tripping over... something (suspect it's because I continue to have difficulty wrapping my brain around the operation of the ProFields Table field; also, a bit shaky on PageArrays in general). I have a links page that includes a "title" field, a "categories" field and a "urls" ProFields Table. The urls Table has rows/fields for "poiurl" (the actual full url), "urltext" (the link as I want it to appear), "desc" (an optional description field), and "place" (a dropdown select populated by another page). I can get the appropriate links page (filtered by a previously defined "$pcat" category), grab all the urls from the Table, and display them. However, I cannot figure out how to limit those results by a particular field—in this case, "place," as I want to return only those links that match the current page's "place." $place=$page->place; $links = $pages->get("template=links, categories=$pcat"); echo "<h4>$links->title</h4> <ul>"; foreach ($links->urls as $u) { if ($u->desc) echo "<li><a href='$u->poiurl'>$u->urltext</a> ($u->desc)</li>"; else echo "<li><a href='$u->poiurl'>$u->urltext</a></li>"; } echo "</ul>"; So, how do I get it to show only the $u results wherein $u->place=$place? Thanks!