Using Ajax with Multiple Filters for pdoPage or getResources

I have tried using ajaxMode with pdoPage and I can’t seem to get it to display results without reloading the page. Here is my call:

[[!pdoPage? &parents=`159` &limit=`5` &ajaxMode=`default` ]]
[[!+page.nav]]

In addition, I would like to apply multiple filters to the results so that the vistor can filter by various factors such as location, title, and speciality (the results are a list of people).

Does anyone have examples of successfully implementing something like this (with or without using pdoPage).

Thanks!

  • Dou you have a <script> tag somewhere in your template for jQuery?
  • Did you try using the example code from the documentation (with the surrounding tags <div id="pdopage"><div class="rows"> ... </div>... </div>, so that the JS-code knows where to put the result from the AJAX-request)?

On the client side, you’ll have to add a form (so the client can enter the filter values) and some javascript code that triggers the AJAX reload.
There is an example here in the pdoPage documentation.


On the server, you’ll have to add a &where property to the pdoPage call and create a snippet that generates the value of this property from the request parameters.
Something similar to the example here.
(Maybe you could also use the extra FilterWhere for this.)

@halftrainedharry thanks, we ended up custom programming for this.