Hello,
As I worked locally on the structure of my website, I’ve first putted my projects in sub-folders with respective prepended numbers. Then I decided to put them back together in the same (parent) folder and after changing all their prepended numbers I have the bad surprise that they (the numbers) are all gone after refreshing the web page. :-/
I’d say it’s something going on with mySQL but since it’s file-based system…?
Please help, thank you!
Someone had this issue before: Numbers being stripped from folder names
This is a strange issue, because nothing should actually happen to the file system when you refresh a page. Are you using any sorting on the front-end? Or do you sort your pages via a blueprint setting?
Hi texnixe,
sorry I’ve checked the forum for a similar issue, not enough apparently. Thanks for your quick response, well I use no sorting except a sortBy() in a snippet. Oddly this is where the problem comes from, when I remove it from the line folder numbers will stay…!
Would it be that having it changed from ascending to descending, plus the folder reordering getting the problem…?
What do you try to sort by in your template?
Could you post your template and snippet code for testing please? Are you on Kirby 2.2.3?
Hi, I’m on the last Kirby version, this is the code I was using :
<?php foreach(page('work')->children()->visible()->sortBy('sort', 'desc') as $project): ?>
...
<?php endforeach ?>
As i decided to change and sort my projects by date – with a date: field in the project blueprint – now when I change the sortBy from ‘sort’ to ‘date’ it’s working without any issue!
It looks like the ‘sort’ sorting makes the folder prepended numbers disappearing in my template, maybe after my folder reordering…(?) I don’t know how could I share the entire of this since I’m working locally for now.
It the “sort” you tried to sort by actually a field? If so, you would have to rename it, see this post.
If you wanted to sort by the usual sort oder if the numbered folders, you would not need to sort your pages at all because that is the default sort order anyway; if you wanted to reverse the standard sort order, you could just use flip()
.
But anyway, seems you have changed your mind and are sorting by date now, so I consider this topic solved?
Yes it is solved. And thanks I didn’t know about the flip()
.