Jon Posted November 27, 2018 Share Posted November 27, 2018 Hello All, I'am struggling a bit (or maybe approaching this wrong). I've creating a simple events section which has a number of categories setup as pages. I've used a multiple Page Reference in the individual events to selects which categories the event may fall under I'am in the process of setting up sidebar which lists all the categories which is fine. Now i would like to have the number of events in brackets at the end. However I cant seem to check the page reference for the category page ID, Ive used the following code :- <?php $cat = $pages->find("template=event_cat, sort=title, include=hidden"); foreach ($cat as $cats) { $count = $pages->count("template=event, event_cat*={$cats->id},"); echo "<li class='uk-active'><a href='{$cats->url}'>{$cats->title} ({$count}) </a></li>"; } ?> Is it something to do with using the ID with *= Cheers Jon Link to comment Share on other sites More sharing options...
adrian Posted November 27, 2018 Share Posted November 27, 2018 Does this help: https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#page-gt-references 2 1 Link to comment Share on other sites More sharing options...
Jon Posted November 28, 2018 Author Share Posted November 28, 2018 On 11/27/2018 at 7:58 AM, adrian said: Does this help: https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#page-gt-references Hello Adrian, Sure does! ended up going with $page->numReferences; after updating to the latest version of PW Thanks 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