Lively Theme not displaying more than one browse preview per page

Hello!

I am running into an issue with the Lively theme and having multiple browse preview blocks on a single page.

If I have more than one browse preview, the theme only displays the items in the last browse preview block. It still shows the title and a “browse all” link for earlier blocks–but not the items, even though they do appear when I click view source.

This does not happen in the ThanksRoy theme.

Any ideas what might be causing this behaviour?

Hi, it looks like you found a nice bug due to the way the Masonry grid is getting instanciated in the browse.js script (I often have the same issue using Isotope).

To reproduce the bug, simply put 2 browse preview blocks on a page. The first grid has a zero height:

My workaround consists in adding a delay before the Masonry gets instanciated. It works fine on my Omeka-S with the Lively theme.

Open the /themes/lively/asset/js/browse.js file, scroll to the end of the file and apply the following modification:

...
// replace this code with the one below
/*
if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', browseScripts);
} else {
    browseScripts();
}
*/
document.addEventListener('DOMContentLoaded', function () {
  setTimeout(function() {
    browseScripts()
  }, 200);
}, false);

Then refresh your browser to make sure the browse.js is updated and it should display your grids as expected.

1 Like

Thanks @boregar and @bakerstewart . This issue was already fixed in the master branch of the theme and will be included in the next release. In the meantime, you can download a copy of the master branch and use it.

Thanks.

1 Like

Thanks, both!

@nelsonamaya, there is also a pretty simple fix with the skip link in Lively having an incorrect URL (there’s already an issue for it in the github repo) in case you weren’t aware of it.

Thanks @bakerstewart! We are aware of this issue and I think there’s a fix already in place for it but I’ll double check and will make sure it is included in the next release as well.