I have a problem where I just can’t get ahead. I am including a CSV file as a Virtual Page and have followed the tutorial for this (Merging content sources | Kirby CMS).
Everything works so far, but everything breaks down when the status of the Virtual Page is changed, for example from listed to unlisted.
The page is visible only as draft in the content folder, but it is still listed in the panel. Also - and this is the bad thing - all previously assigned image elements are deleted for entries that use the page model that is responsible for the import. They are still present in the content folder, but they are no longer displayed in the panel and frontend. Also the respective media folder with the corresponding hash is empty.
Does anyone have an idea how I could get ahead here?
The problem probably arises from the fact that the pages have a prepended number: 'num' => 0, so they are by default listed. Do all your virtual csv pages have a folder in the filesystem?
Yes. It might be be easier to do it vanilla kirby and I am considering it. But the integration of a CSV-file is the first step in automating the system. So having the option would be very welcome.
You would have to extend the model to make this work, or rather, you will need a model for the single page as well, to keep the virtual stuff and the stuff in the file system in sync. But I nevertheless wonder if it wouldn’t make more sense to create the pages from the csv file programmatically and if need be to update. But I don’t know your use case for using the csv data.
Im jump in this conversation
Because have similar request
I have data placed in spreadsheet.
I have many sites that will use this data in feature based on it parts
I wish to be connected to this data and have ability create virtual pages (in some other topic I’m already write about this)
It gives me possibility to filter wich games should be imported filtered by Software
What I can’t do is to delete pages if deselect Software, I can’t change status (I’m try do it in this model but it doesn’t work)
Im also think that it must be a Game Model but didn’t understand what should be there
In total I need to have ability import page, ability to make changes inside imported pages with part of content, ability to change status for this pages even if it imported (for example Im select all games from one Software provider but for some reason don’t need some of its games), ability to delete imported pages if I deselect Software from filter
Also As you can see in my model I’m import in json all data and after that create pages based on filter, I think for speed may be better create filtered json with only selected Software
Don’t know if I wrote everything clear, but I think it would be great option to create some universal Guide to work with imported data with ubility not only import all data, but to filter it, change status or even delete
I think I understand what to do) but still didn’t find how to make it works
We can create default column in spreadsheet “Status”
When I generate Json this column will be still empty
And from this we need to do 2 steps
Somehow on change status catch this status and set it inside json
in this way generated pages list should be updated
the second step is when spreadsheet will be updated merge it with created json all columns except Status column that is updates from panel
I create updated model but how to put status inside json I still unluck with this