Jump to content
Jon

Counting Number of Pages using a specific Page Reference

Recommended Posts

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...