Load more button

I install xampp. Change localhost to demo domain name in Windows hosts file. Now its url is http://brosco-mall.local/en/events
and it still doesn’t work. How should I config my local server for properly work :face_with_spiral_eyes:

Could you show me what I need to write in events.php template/controller to generate JSONs with pagination? I don’t understand what means:

call the content representation with a parameter or query string to separate between past and present

But I want to remove empty pages that I have now from empty templates.

Maybe I use wrong php version or php.ini
Could you share your config?

Not in events.php controller, but in events.json.php controller. Basically, my idea is to call http://394.test/events.json with a parameter or query string.

So when calling the url

  let url = `${window.location.href.split('#')[0]}.json/page:${page}`;

you would add a query string at the end:

let url = `${window.location.href.split('#')[0]}.json/page:${page}?events=past`; // or future for the other collection

And then in your json controller filter by this query string:

$event = get('event');
$events = $kirby->collection('events' . $event')->paginate($limit);

then the rest would be exactly like in the original recipe.

What i’d suggest is that you get the original recipe working first, then you can continue with the more elaborate setup for the two collections.

Oh, and one more thing I keep forgetting since I never work on Windows: On Windows, the parameter separator needs to be a semicolon instead of a colon, so page;2 instead of page:2.

Wow, nice. Now it works on my local server :star_struck:
So, should I use ; only when I run this project on my PC? I guess if I save it, it won’t work on client’s server.

Yep, that’s Windows specific.