on my site I have a bunch of projects. For each project I would like my user to be able to choose to let it appear in the gallery or/and to appear in the calendar section.
So I thought I go with two pages fields, one for each purpose. That works kind of, but in the calendar pages field I would like to sort the projects automatically by a date field on the project page? Is there any way to do this?
That only sorts them in the selection dialog. I actually need to have them sorted in the resulting list (and therefore need to disable manual sorting, but I could do that via some custom panel CSS, if necessary).
Ok, I only tested this with a title field now (but I guess it should work the same), hereās the issue:
I click select and select āProject Bā and hit OK, āProject Bā gets listed.
I click select again and now select āProject Aā and hit OK. āProject Aā now gets listed below āProject Bā because it was added last, although according to my sorting idea it should automatically placed above āProject Bā.
So unless I am misunderstanding you, I donāt think the list entries come out sorted exactly like in the list.
Which is not how I intend the panel field to be used. I wonder what else I can do?
I guess I need to sort them via a hook and then rewrite the pages field somehow, maybe?
The problem is probably that the field stores stuff in the content file. You could use a hook that sorts them after saving. Donāt know if it would work with a before hook as well. But the best solution would probably be a custom field.
Ok, thanks. I will look into these options and will see what would be my best bet in this scenario. I donāt feel comfortable using Vue, but if I find time I will look at the video tutorials. I think it would make for a good new feature though, thatās why I created the idea issue. If anyone comes accross this, feel free to upvote the issue, if you also think the feature would make sense.