A pages field expects pages as input. What you could do is convert the structure field items of all work-item subpages to pages and return those from a custom method.
This is assuming that the structure field contains a pages field. Could you post the blueprint definition for the editions structure field?
As in the frontend we can treat structure items collections as if they were pages collections, through toStructure(), I was wondering if perhaps I could do something similar in the panel with the pages field.
What I don’t understand: What would your user actually select here as an edition? One item in this structure field? But by what criteria, as these editions don’t seem to have a name they could be selected by?
If it is, I could perhaps custom build what is going to be displayed, in this case it would make sense to show ‘name of work-item’ + ‘| ed.’ + structure item index’ + ‘/’ + ‘total structure items’, something like ‘This artwork’s title | ed. 2/4’.
More importantly, you will need something by which to find the selected item again. For the moment, I’m not sure if the combination of all fields in an item will be unique and will make it difficult to find the right item again. So I think some sort of unique ID would be needed. Maybe assign an AutoID via the AutoId plugin?
We could then collect all structure items of all subpages into a single collection and convert them into virtual pages in the subpages model (introduce a method virtualChildren or something like that). But as I said, these pages would require a unique slug.
Are you already on Kirby 3.8 or on a previous version?
Thanks texnixe, I’ve been discussing with the client, and I think we are going to migrate to using pages, as this solution seems overly complicated and may bring headaches in the future.
But what you propose sounds like a pretty interesting thing to try. Thanks for that. Although I’d perhaps try to use the parent unique ID + the index of the structure item on the structure items collection, as the unique id of the structure item itself. As this should be unique, shouldn’t it.
Btw, I have a few licenses bought before 3.8, can I use them in 3.8?