Order unlisted pages in Panel

In the Panel I can reorder Listed pages, but not Unlisted pages.

Is it possible to reorder my Unlisted pages? At the moment they are listed alphabetically. I’d like to be able to list / display them in order of importance.

You cannot order them manually, you can sort them, by date, by any other field or a combination of fields, see page sections documentation.

So if you want to sort them by importance, and you want to keep them unlisted, then you need to add this information to the page.

But then the question is: Why have them unlisted?

Perhaps I’m not sure what I’m doing!

So, my Listed pages appear in my nav bar. But my Home page isn’t in my nav bar and so currently sits about half way down the list of Unlisted pages. Which is kinda weird. I then have other odd pages in the list of Unlisted pages: ‘Error’ and a ‘turn-off-analytics’ page.

I’ll take a look at this info: Page blueprint | Kirby CMS

It might make sense to have different sections, one for the pages that are important, and one for the rest, or even do not show some pages like the error in the section at all. After all, you don’t usually edit your error page, and what is a “turn-off-analytics” page? Wouldn’t this rather be a setting in the site object?

Yeah, that makes sense, not to show some pages at all. But how do I do that? I thought all pages appear in either Listed, Unlisted or Draft?

This is my site Blueprint:

title: Site

sections:
	listed:
		type: pages
		status: listed
		image: icon

	unlisted:
		type: pages
		status: unlisted
		image: icon

	drafts:
		type: pages
		status: draft
		image: icon

No, you can create as many pages sections as you like, and you can name them whatever. Then filter by template(s)/status and parent. Take a look at the site.yml blueprint in the Starterkit for an example.

Then in addition to that, you can use tabs to separate pages sections from other stuff (meta data fields, for example, or general stuff that is of site-wide relevance).

Have a look what people do with their site.yml blueprints here: https://www.kirbysites.com

Thanks.

My site Blueprint is now:

title: Site

sections:
	listed:
		type: pages
		status: listed
		label: Listed in nav bar
		image: icon

	other_pages:
		type: pages
		templates:
			- home
			- portfolio-services
			- default
		label: Other pages
		image: icon

	drafts:
		type: pages
		status: draft
		image: icon

I’m hoping to be able to list the ‘Other pages’ by template used. But in the Panel only the home page is displayed. I can’t get pages using the default or portfolio-services template to display.

There might be an issue that some pages using the default template are also listed. In the other pages section I want unlisted default pages.

Are all these pages direct children in the content folder?

Yes, they would then show up twice, in the listed section, and in the other_pages section. In that case I’d probably use different blueprint/template names.

Are all these pages direct children in the content folder?

I’m not sure I understand the question. I believe so. Many of my pages use the default template and three use the portfolio-services template. See screen grab

Hm, I wonder why there is no hierarchy and just a flat list of pages.

What’s the purpose of those portfolio-web-design/portfolio-graphic-design etc pages? Looking at your website, they seem to serve as filters for the portfolio subpages only, so why have them as separate pages cluttering the main folder?

If I were you, I’d reconsider the structure (but of course, I’m not :joy:)

Hm, I wonder why there is no hierarchy and just a flat list of pages.

Several of those pages are linked to from only one other page, or not linked to at all.

The portfolio-branding, portfolio-graphic-design and portfolio-web-design pages do act sort of like a filter of the portfolio, but I intentionally want them to be stand along pages, so that I can easily send someone the URL. (and working out how to do that using a filter was beyond me)

Any ideas why the Panel is only showing the home page and not all the pages using the default template and portfolio-services template?

There are many child pages inside the Portfolio folder (so it’s not entirely flat hierarchy).

It’s not portfolio-services, but portfolio-service, looking at your screenshot. And I don’t see in that screenshot where you are using the default blueprint, I see text-page

Well spotted. Thank you! I’ve removed the ‘s’ and portfolio-service pages are now listed.

And I don’t see in that screenshot where you are using the default blueprint, I see `text-page

Hm, I have a default.php template and a default.yml page blueprint. I presume because I don’t have a template or blueprint called text-page these pages are defaulting to the default.php template and default.yml blueprint? Okay… so to get the default pages to show up in the Panel I need to rename the text-page.txt default.txt?

UPDATE: yes that works.

THANK YOU (AGAIN)

If you want a quick way to exclude the home page from the nav bar, you can do this

<?php foreach ($site->children()->listed()->not('home') as $item): ?>
  <a href="<?= $item->url() ?>" class="nav-item"><?= $item->title()->html() ?></a>
<?php endforeach ?>

The home page will still be listed, it’s just excluded from the foreach loop.

Documentation for not()

1 Like