maddmac Posted May 31, 2020 Share Posted May 31, 2020 What's the best way to exclude the current page from results without resorting to filtering the results in a FOR LOOP. $news = $pages->find("template=news-article,sort=-publish_date, publish_date<$today"); In this example If I want to exclude the current page how would I do that? Is there a sibling reference? Link to comment Share on other sites More sharing options...
kongondo Posted May 31, 2020 Share Posted May 31, 2020 24 minutes ago, maddmac said: In this example If I want to exclude the current page how would I do that? $news = $pages->find("template=news-article,sort=-publish_date, publish_date<$today,id!={$page->id}"); PS: if publish_date is a datetime field, then ProcessWire already knows 'today' (string) ?. 3 Link to comment Share on other sites More sharing options...
maddmac Posted May 31, 2020 Author Share Posted May 31, 2020 Thank you kongondo Link to comment Share on other sites More sharing options...
Recommended Posts