All you need to do is put a files section somewhere, perhaps in site.yml or even make a dedicated page. This will allow you to upload files. If you wish, you can then use subpages to make albums up, to group certain kinds of images together.
Then you can use the new query language on a files field in your other pages to pull those images in, regardless of where they are. Theres an example in reference for doing this on the files field.
What is your use case for copying all files to the assets folder? In Kirby 3, all files are moved to the media folder (i.e. outside the content folder) by default, anyway, so copying to the assets folder additionally doesn’t seem to make that much sense.
If you still want to move all images to the assets folder, you can of course do that using Kirby’s hooks as before. The only thing that has changed is the name of the hooks and how you register them.
the main reason for having all images in one folder is maintenance.
the only files in the media folder are the thumbnails and the main images are in the content folders.
so if i upload images inside the panel, they are moved to the media folder. but these images are thumbnails.
good point “file.create:after”
but makes no difference, file not written anyway.
F::write( kirby()->roots()->index() .’/logfile.txt’, ‘write something’ );
Ah, that’s what I thought. Could can’t have two return statements, when a return statement is encountered the control is given back to the calling script, so anything following that return statement is ignored. so you have to put it all into the same return array.
Again, please mark up your code in backticks please, like this: