Masonry.js on category page

NodeBB Development
  • How can I apply masonry layout on category page? Consider that I am building my nodebb theme based on vanilla theme. So my category page looks like this and that is not cool as you can see. 🙂
    I called masonry.js in plugin.json following the lavender theme example and copied the content of lavender.js file into mine. I tried to make it work by changing this code masonry = new Masonry('.row.home > div'

    into this

    masonry = new Masonry('.row.category > div'

    It didn't worked. Is that even possible to do with just changing lavender.js to affect on category page instead on homepage?

  • @Jelena You're not pointing at the good element. It's a few childs after :
    masonry = new Masonry('.row.category ul#topics-container li')
    btw the .row.category ul part is not needed 😉

  • @esiao That didn't worked, it looks like it doesn't even loads masonry.js for some reason. How can I see is the scirpt loaded and is it loaded correctly? Maybe some cmd command? I followed all instructions in setting up plugin.json and theme.json and I am pretty sure that I did it right. I can't figure out what can be the problem. Any other suggestions?
    Tnx anyway ^^

Suggested Topics