Nextcloud gridview

Display Grid View as default in shared links

  1. Open core/js/public/publicpage.js.
  2. Inside the window.addEventListener('DOMContentLoaded', function () { closure, add the JS.
  3. Save.

Append #view-grid to any shared URL.
For example...
https://YourDrive.com/s/daBAWTg3aa3FMLS#view-grid

// Execute if onlyOnViewGrid is false or if the URL hash is "#view-grid"



let onlyOnViewGridUrl = true;



if (!onlyOnViewGridUrl || (onlyOnViewGridUrl && window.location.hash === "#view-grid")) {



    $('#view-toggle').removeClass('icon-toggle-pictures').addClass('icon-toggle-filelist');



    $('.files-filestable').addClass('view-grid');



}

Rate this FAQ

0 (0 Votes)