Button: Load more CMS items

I’m using the following code to load more cms items via click on button. It’s working great, just wondering how I can adjust the amount of items showing up on desktop, tablet, mobile.

e.g. desktop show/load 4 items, tablet show/load 3 items, mobile show/load 1 item

Is there a simple way, to add this to the code?

Thanks in advance.


1 Like

Not simple. You would need to determine the width of the viewport and then run conditional statements.

I just have to ask why force people to click to see content repeatedly. It is not very user friendly IMHO. Why not use infinite scroll?

Hey @webdev,

the design calls for it. I’d also need to add this for two different collections triggering with two different buttons, but on the same page. Basically just using it twice on one page.

How would I do this?

Thanks a lot!


@sabanna @Siton_Systems Do you have any idea, how to achieve this?