This will automatically switch a public or shared folder to gallery view when loading.
This only works on public or shared folders on Nextcloud and will not affect normal folders viewed under your user account.
Tested and working on Nextcloud 27+.
- Open
core/js/public/publicpage.js
. - Inside the
window.addEventListener('DOMContentLoaded', function () {
closure, add the JS. - Save.
Append #view-grid
to any shared URL.
For example...
https://YourDrive.com/s/daBAWTg3aa3FMLS#view-grid
Set onlyOnViewGridUrl
to false
which will cause the gallery/grid view to be shown each time without having to append #view-grid
to the URL.
- This is a workaround that will be lost when you update Nextcloud. You will have to reapply it each time you update.
- Beacuse a Nextcloud file has changed, the file integrity check will fail. That's okay, it just means that because the file doesn't match the original file it will give you a warning on the
Overview
page.
nice patch, it's a shame upstream nextcloud doesn't support something like this