Display Grid View as default in shared links
- 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
// 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');
}