Hi,
I have created a post-like structure like this:
Page: Posts
Page: Category
Posts has a field called "category" which is derived from the Category page's children - these children simply have a title field e.g. ("Events", "News" etc)
I would like to filter the children of Posts based on this field, something like this:
$posts = $pages->get('/posts/')->children("category=events");
However category is a number, in my case Events is the number 1014. Obviously I want to filter by a string instead. How can I do this?
Thanks in advance for your help!
///////////////////////////////////////
Apologies, after I wrote this I saw a related page at the bottom. Here is the solution for completeness:
http://processwire.c...a-selector-tag/
$category = $pages->get("/category/events/");
$posts = $pages->get('/posts/')->children("category=$category");
Nice and easy