Hello, first post here!
I've been experimenting Grav for some weeks and I love it! Modular pages are a stunning feature so is its speed.
That said, I ended up trying to create a theme fitting my needs.
I'm not completely new to web programming however my (limited) experience has been paused for the last ten years and a lot has happened. I primarly worked with PHP + CSS 2 and a little bit of jQuery.
I decided to start with the minimal Pure CSS framework, here's the first issue: how do I output in HTML the number of pages of the menu? This is needed in order to use Pure's Grid System i nnavigation menu.
I tried children.count() but it doesn't seem to fit this case. Or maybe I'm using it the wrong way.
Thank you!
Marco
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Solved by pamtbaau View solution
@phmg701, Welcome to the forum!
I wonder what you need the count for as the 'Pure' theme uses a <ul> for its menu-items.
Anyway, to get the count of visible root pages, try: pages.children.visible.count
And to get the count of visible children of the current page: page.children.visible.count
Have a look at the docs on Theme Variables where the Page and Pages object are mentioned.
Thank you, this just works!
My aim is to build a photo gallery based off PureCSS grids and those variables will be useful.
But I'm still far from this point, I'm struggling with navigation menu 😅
I'm also trying to understand how the Docs work as I'm not that used to such schemes (coming from WordPress Codex).
Thank you!
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 60 | 15 hours ago | ||
| 2 | 66 | 18 hours ago | ||
| 1 | 33 | 19 hours ago | ||
| 2 | 69 | 6 days ago | ||
| 2 | 61 | 6 days ago |