Automatic Sort by Number of Subpages

A question about making pages visible:

When adding the first subpage in a page, the visibility pop up looks like this:

When a second page is added the pop up looks like this:

Is it possible to always keep the first pop up screen style plus the new sub page automatically to get the highest number and always be on top of the list with sort: flip ?

There will be tons of subpages and looking for a way to automate the publishing process.

@texnixe wrote a plugin for importing / creating pages via CSV, which will save you save you a lot of manual clicking around. I have not used it but i’m sure she will help you out if you get stuck.

It’s also worth noting that you do not have to use the panel to set the visibility. Folders are numbered if they are visible, so you can always use a batch file renamer to append sequential numbers to the folders. You can also do this with a bash script if your on Linux / OSX or via the Ubuntu terminal in the latest version of windows 10.

Auto Publish Plugin does this when a sub page is being added, but there’s an issue in my case using the plugin. It is in conflict with subpage builder in my blueprint, so I’m looking for an alternative way to make content visible faster - aka if there’s a way with a single click.

Do you have to use numbers? If you sort by date, for example, you don’t have that problem.

Hmm maybe a page create hook, and a little php to rename the files.

The problem is that hooks don’t work if you use the page builder (that’s what the Auto Publish plugin is doing)

Really doesn’t matter if it’s numbered or not, it’s all about that each new page be last without having to specifically choose.

I tried using num: date in site.yml (as it keeps that simple yes/no pop up window) ,but when posting few pages to test, they get out of order after few new pages have been added.

Page 4
Page 3
Page 2
Page 1

and after Page 4 the order changes for some reason. Is it maybe related to editing one of these pages? Would that be changing the order after they are visible?

Hm, if you publish multiple pagea per day, you probably have to use a datetime field (and set default to now). No, the default is that the date is not overwritten when the page is edited.

Edit: I just tested numbering by default numbers, and if you just click “change” without choosing a page number, the page automatically picks up the last number. It’s probably not super intuitive, but it works.

What about using Auto ID? The problem as I understand it is that you just want some form of consistent ordering that sticks.

Maybe the issue is that i post few pages in a row and kirby gets confused? Will try to datetime field and set it to now see if that works.

This is what happens after few pages. Order breaks after 4

Seems it’s also positioning them alphabetically or something

@Rrr Have you seen my edit above?

Just did :smiley_cat: and will try it out now.
Still really strange if ordered by date.

Well, these pages are not visible yet, are they?

Absolutely sure they are as I changed all of them manually after creating them