Page count adding modules

Maybe it’s me, but ran into an admin problem. We made modules hoping to allow the client to create pages after we hand off. But the modules are adding on the page count. Did we set up something wrong? Is there a way that all the modules will call under one page and just make “1” for the page count? Unspecified

A modular sub page is in fact still just a page to Grav, hence why they are in the page count. When we refactor how modular pages are built and hide their pageyness from the user, we’ll probably remove them from counting towards the overall page count, but it doesn’t make sense to do that now.

ok thanks for clarifying

Of course this is just a temporary solution (any update to Grav core will overwrite it), but you can always change the file user/plugins/admin/classes/admin.php and find:

public function pagesCount()
    {
        if (!$this->pages_count) {
            $this->pages_count = count($this->grav['pages']->all());
        }
        return $this->pages_count;
    }

and replace it with

public function pagesCount()
    {
        if (!$this->pages_count) {
            $path = $this->grav['pages']->root()->path();
            $this->pages_count = count($this->grav['pages']->children($path));
        }
        return $this->pages_count;
    } 

@rhukster : I don’t see this change impacting other areas, does it? It would be much more intuitive from a user perspective for the badge to count only non-modular pages.

Because modular pages are currently ‘displayed’ as regular ‘nested’ pages, i think it would be weird to change how the page count is rendered now.

From a user perspective (not from admin or developer) it is weird to count nested pages as regular pages. I would really like to propose this change as it reduces confusion for a regular user.