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.
Agreed! You would think it'd be an option.
For photos, this is a great feature. For files, I prefer the existing list view. Similar to how Window Explorer will detect photos vs documents, I wish Nextcloud did the same.