nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.76k stars 4k forks source link

Album/Grid view by default on shared folder #29013

Open martinoshub opened 2 years ago

martinoshub commented 2 years ago

A very typical use case for NextCloud would be to upload photos to a folder and share it with a family member, who is a less technical person and/or may not spot the tiny grid toggle button in the top right hand corner. To them, the file list view by default is a massive letdown - a grid of thumbnails would serve them much better.

I'm lost as to why an option to link to the grid view is still a problem in the current version (22).

I've googled suggestions and solutions. They range from this option existing (or even being the default) in previous versions, through ability to add #grid-view at the end of the URL (which no longer works), to manually hacking into JS files to sort-of get this result (and then lose this feature on the next update).

I'm not even asking for this to be a fancy option in the Share box, I would be happy if I could simply just append #grid-view at the end of a shared URL and send that link to people (without having to create an account for them).

Adding the ability to show public shared folders in an album (grid) view would be a great overall improvement to Nextcloud in my opinion. It can't be that hard, just make the page listen to a # parameter and simulate a click on the grid toggle button. Thanks in advance for considering this request.

Edit: the 'hacky' way in the current version to make it default to a grid view (instead of a list view) is:

line 401: apps/files_sharing/lib/Controller/ShareController.php $folder->assign('showgridview', true);

Still, a URL hash option and/or a config.php variable would be great though, I haven't dug that deep.

Jerome-Herbinet commented 2 years ago

Adding or restoring support for a parameter at the end of a URL seems fine to me, but it doesn't seem to me to be a sustainable solution from a UX/UI point of view.

The ideal would be :

  1. to add this choice in the sharing options (desktop browser interface + mobile client + sharing options in the file explorer when the desktop synchronization client is installed)
  2. to store this choice by default in the database, where the sharing parameters are located (this is in my humble opinion cleaner, more durable, and more scalable)

I realize that this would be a lot more work than just using a parameter at the end of the URL, but it would be a big advantage.

Indeed, for years, when I share photos, most people don't see (or understand) that it is possible to change the view.

Also, as someone who shares photos from the "Nextcloud Photos" app, this behavior is even more incomprehensible (frustrating) because in this app, images are displayed in thumbnail mode all the time (so why would the shared view be different from the view in Nextcloud Photos).

That said, I did understand that the side panel and its tab dedicated to sharing comes from Nextcloud Files (common core).

h4knet commented 2 years ago

in NC 23.0.8 it's on line 428.

From:

                        // default to list view
                        $folder->assign('showgridview', false);

To:

                        // default to grid view
                        $folder->assign('showgridview', true);

You also have to change the line 441 in order to have the corect number of images loaded by default :

                        // default to list view
                        $shareTmpl['showgridview'] = false;

To:

                        // default to grid view
                        $shareTmpl['showgridview'] = true;

It's working correctly for me ! Thanks for the research.

pascalBokBok commented 3 weeks ago

The ideal would be :

yes. But two years later a "#grid" or "&ui=grid" would be great :-)