Hubris Posted March 22, 2019 Share Posted March 22, 2019 Hi there! I'm using some page reference fields to create lists of tags, categories, years, etc.. I'm able to find the pages like so: $pages->find("template=project, {$filter}={$page->title}"); Which dynamically does something like: $pages->find("template=project, tags=Experimental"); Only if the value (the page name, like "Experimental") starts with letters. If it starts with numbers, find returns nothing. Why is this and how can I fix it? Link to comment Share on other sites More sharing options...
Robin S Posted March 22, 2019 Share Posted March 22, 2019 No problem here finding matches for a Page Reference field containing pages whose title starts with numbers. If the search value only contains numbers then the value will be interpreted as a page ID. In any case it's good to be specific about what you are wanting to match against to avoid any confusion. So if you want to match against the title use tags.title as $filter in your example. 2 1 Link to comment Share on other sites More sharing options...
Hubris Posted March 22, 2019 Author Share Posted March 22, 2019 Correction for future reference: indeed, with only numbers. I thought it was about being interpreted as page ID, but a type conversion thing. I have no ideia how I missed subfield selectors... -_- Thank you! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now