Well, I believe I found the issues.
The first was a silly copy/paste mistake.
In the Subpage builder, when correcting the line:
$subPage->sort($build['num']);
I used:
$subPage->changeSort()($build['num']);
instead of:
$subPage->changeSort($build['num']);
Note: It might be helpful if kirby docs on the Subpage builder’s code. is updated.
Once I finally sorted that out, the next difficulty was a little more perplexing.
I’m testing all this on a Windows 10 machine running MAMP.
For some reason, some folders are sometimes being locked by Windows, so they can’t be changed by kirby. This caused error messages that sometimes led to no changes taking place, partial changes, or changes where the Panel would need to be refreshed. One “breaking” partial change is when a published piece is deleted, the renumbering of published pieces stops half way if one of the other published folders is locked - resulting in broken numbering.
All well now, hopefully.
Some good lessons learnt by this beginner while figuring all this out.
One is that for the Subpage builder plugin to not “Publish” the new subfolder, but to just have it “Unlisted”, I could choose:
num: null
The other lessons learnt was getting a better idea of how - blueprints / folder-names / file names - work in the Panel. This is what I understood:
In a BLUEPRINT, the template option refers to a blueprint! This concept concept causes confusion, because displaying a page on the website also uses templates, so it is disconcerting when using the template word to refer to a blueprint.
When a new page is created:
- the new page is created in a folder with the name of the slug of the Title name (or anything the slug is manually modified to)
- the page-data-text-file within that new folder will have the name of the (blueprint)template specified for its creation
If the new Page is added without the blueprint specifying a (blueprint)template:
- A Select box of possible templates is given when Adding the Title.
-
- If a selection is not made, it auto chooses the first blueprint-template (top of the list)
-
-
- This is quite easy to overlook! Intuitively, one expects 1st - a (blueprint)template matching the slug to be highlighted, or else 2nd -the default template to be the highlighted one, but it isn’t either. Just the alphabetically first in the list.
When a blueprint wants to show a page in a list, the template that created the page must be chosen!
- Page-data text-files named
a.txt
need the blueprint to specify a (blueprint)template of a
(.yml) for that page to show up!
- Same way, if a page-data-text-file is named
default.txt
, the (blueprint)template to view it has to be set to default
(.yml)
I would appreciate that, if any of what I said is incorrect, it could be clarified.
Thanks.