I have a lot of clients that come from a WordPress environment and are used to having a media section in their admin panel where they can delete the files that they don’t use anymore. Some clients are doing a terrible job on keeping their sites “clean” so I was wondering how other people deal with this “problem”. What’s considered best practice when working with client that like to upload a lot of different versions to test things, duplicating pages incl. Files etc. I have a potential project that I really like to do within Kirby but this might be a deal breaker for them…
Is there a way to create a similar section as the WordPress media library (I know you can’t see whether an image is in use or not).
If I understand you correctly, you don’t want to store the files in a single place, but rather offer a view where users can manage all files uploaded to all pages, without indicating if they are used anywhere?
This could be achieved with a custom Panel area: Panel areas | Kirby CMS
Here are two example recipes:
Thanks Sonja I’ll look into these cookbook recipies:) Still very interested in hearing from other people how they manage these things/experiences.
@texnixe I went to recipe but I have no experience with Vue components. I ran the build, I have a panel area now that shows the headline and icon but I have no clue on how to get all the media from the site to appear in that Vue component. Is there any chance you could point me in the right direction here? My component now only contains:
You pass the data from the php part to the Vue components. If you go through the advanced example step by step, it should get clear. Maybe try the recipe first to get a better idea how it works.
Ok. So I managed to get all the uploaded files to be shown on the page. They have a link to the file panel view where the file can be deleted. However I would like to be able to delete them from within my plugin. I can’t seem to find that in both of these recipes (or I’m missing something). What’s the best way to do this?
In the advanced Panel area recipe, we have implemented actions to delete, edit etc. (when clicking on the three dots) the entries. You can do the same for deleting files.
Theoretically, it could even work with a files section inside the area, this section should then come with the functionality already built-in, I think.
If you can’t do it yourself, why no hire someone to do it for you?
I’m really interested in your solution afplaktape. could you post it when you are ready?
Here you go: GitHub - texnixe/files-area. Adapt to your needs.
Wauw Sonja Thank you very very much:)
why not only store all files in $site and use the query language to connect page file sections to the files from $site?
Because selecting from a huge list of images can be a pain, particularly if image are only related to a small section of the page and need not be reused across the site.
Guess there are different ways to go about handling files depending on the requirements of the site.
- Files likely to be reused across many pages => centrally stored files
- Files limited to a single page => files stored in page folder