piwigo-bootstrap-darkroom
piwigo-bootstrap-darkroom copied to clipboard
How to force List/Grid views?
Hi,
The view setting (List/Grid) seems to be used as global setting, so if I browse categories in List mode, also the thunbnail are browsed in List mode.
Is there a way to force List view in Categories/Index pages and Grid view in Thumbnails pages in the code?
I'm not practical in piwigo programming structure and I was unable to find a way to do it. (In my case, since I use description in albums but no texts in photos, I'll disable also the change view bottons)
Thanks in advance.
Hi, any way to force List view in categories/index and Grid view in thumbnails?
Thanks in advance
There is currently no way to set this separately.
Ok thank you anyway.
In case others need to do the same, I describe the workaround I implemented (although not really beautiful) to have this functionality.
I've modified the footer.tpl file, adding at the bottom (just before the
statement) a simple javascript code that runs on page load and triggers (with a little delay) the grid/list view buttons, depending of the presence of the slideshow icon (which appears in Thumbnails page).
<script type="text/javascript">
$("document").ready(function() {
setTimeout(function() {
document.getElementById('btn-grid').click();
},10);
});
</script>
{else}
<script type="text/javascript">
$("document").ready(function() {
setTimeout(function() {
document.getElementById('btn-list').click();
},10);
});
</script>
{/if}```
With this workaround, all index and categories pages appears in list view and all thumbnails pages appear in grid view.