# Stats section: counting pages

**URL:** <https://forum.getkirby.com/t/stats-section-counting-pages/26146>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 5, 2022, 11:25am UTC](https://forum.getkirby.com/t/stats-section-counting-pages/26146 "2022-08-05T11:25:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a-z](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/a-z/32/8014_2.png) [@a-z](https://forum.getkirby.com/u/a-z)\
**Post date:** [August 5, 2022, 11:25am UTC](https://forum.getkirby.com/t/stats-section-counting-pages/26146/1 "2022-08-05T11:25:59Z")

</div>

I’m working on a website for a magazine, in the panel homepage I would like to show the count of articles and authors.

I tested the function `page('team')->children()->count();` in the frontend and it works, but I’m not able to make it work in the panel area.

Last attempt works like this:

#### `blueprint/site.yml`

```auto
stats:
  type: stats
  reports:
    - label: Authors
      value: '{{ page.authorCount }}'
      link: /pages/team

```

#### `models/site.php`

```auto
<?php

class sitePage extends Page {

  public function authorCount(): string
  {
    return page('team')->children()->count();
  }
}

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 5, 2022, 11:29am UTC](https://forum.getkirby.com/t/stats-section-counting-pages/26146/2 "2022-08-05T11:29:32Z")

</div>

The site is not a page and cannot have a model, use a site method instead

> **[Site methods](https://getkirby.com/docs/reference/plugins/extensions/site-methods)**

---

<div class="post-metadata">

**Author:** ![a-z](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/a-z/32/8014_2.png) [@a-z](https://forum.getkirby.com/u/a-z)\
**Post date:** [August 5, 2022, 1:22pm UTC](https://forum.getkirby.com/t/stats-section-counting-pages/26146/3 "2022-08-05T13:22:26Z")

</div>

Many thanks @texnixe !  
Using the site methods it works!
