Hey guys,
maybe one of you has an idea, my brain’s somewhat stuck rn: My customer wants to copy files from one page to other pages. So basically he wants to go to the image, click on the ellipsis and chose “copy file to”. Any ideas how to accomplish that?
There is no out of the box way, guess you would have to extend the file view to implement this (don’t know if this is easily possible).
Copying the same file to multiple pages quickly creates duplicate content. One way to avoid that could be to build a central storage page, basically a blueprint with just a files section. Then, from any other page, you let the user select an image using a files field.
the project still hasn‘t launched yet… we started with a global file pool. but with a growing no of onboarding editors this quickly becomes a nightmare: try to keep the same naming strucure or delete some files belonging to a page where half of the files are also used elsewhere. in the end it’s easier to maintain duplicated content with each page than one big pool.
still, the editors need to copy files from the global pool to each page for various reasons.
In the meanwhile i‘ve managed to extend the file.yml to select a target page and upon saving the file to copy it to the very page. however, i‘d also need to empty the target field right after the coping process.
any ideas here?
I guess you are using a file.update
hook to initiate the copy process. You can use $file->update(['yourField' => ''])
inside that hook to reset the field back to an empty value.