Display Grid View as default

How to set Display Grid view as default when sharing a folder of photos via share link ? Because the old method thread is doesn’t work anymore…

I am also curious in this. I try some earlier method where apps/files_sharing/lib/Controller/ShareController.php was edited by changing

$folder->assign('showgridview', false);

to

$folder->assign('showgridview', true);

but there is no this line in mentioned file any more.

I would be so happy if I could know how to change default view to grid in general, not only for shared links, but I would also be satisfied if I could change it for shared at least.

Thx.

Hehe, just few minutes after I wrote message above, I searched for folder->assign string in all /var/www/html Nextcloud files, and I found it, it is located in apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
At this moment (since NC team is changing something all the time :grin:) it is located on line 157. Just change:

$folder->assign('showgridview', false);

to:

$folder->assign('showgridview', true);

and restart your NC instance.

Alternate solution: