Skip to content

Is there a way to list pages? #238

Answered by xenocrat
mord0d asked this question in Q&A
Discussion options

You must be logged in to vote

Hello there,

There's a way to do this without writing any PHP. I'm going to do this with Virgula theme, because it's very simple and so easier to see how the solution is working - but you could do the same thing with any theme. The steps are:

  1. Create a new page with the slug "index-of-pages" and a title of your choice, then save it. Page content isn't important.
  2. Copy the attached Twig template, page_index-of-pages.zip, to themes/virgula/pages/page_index-of-pages.twig.
  3. Visit your new page. It will show a hierarchy of all your listed pages (it won't show pages with a status that prevents listing).
  4. Optionally, set the status of your "index-of-pages" page to "Public" (but not visible in pages…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mord0d
Comment options

Answer selected by mord0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants