picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 616 forks source link

PHP pages depth & offset #701

Closed digitalinferno closed 6 days ago

digitalinferno commented 2 weeks ago

In PHP, can I use something similar to the Twig pages() function?

With foreach ($pages as $page) in onPagesLoaded(&$pages), I can filter the result with $page["meta"]. However, if I need only a specific node tree, I have to play with the id. Are there no alternatives?

PhrozenByte commented 2 weeks ago

There's no direct equivalent, however, if you want to access Pico's page tree directly, you can hook into the onPageTreeBuilt event or use the Pico::getPageTree() method (available only after said event). See https://picocms.org/in-depth/features/page-tree/ for a rather extensive explanation of Pico's page tree.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: