I know that if i have created a new ElementType for my plugin that I can use the same template that Entries uses:

{% extends "_layouts/elementindex" %}
{% set title = "Entries"|t %}
{% set elementType = 'Entry' %}

and that will give me the standard layout with a sortable table.

However is there anyway to tap into the sortable stuff for my own custom table in my plugin.

Or is it simply a case of having to work the sortable stuff myself (which is fine)? I just thought I would ask as I would prefer to use the native stuff if it is easy to hook into.


As far as I'm aware, there is currently no native way to do this without using an ElementType index page.

You have two options for implementing this yourself. One is to sort the table on user input with the help of the registerCpRoutes hook (with AJAX or by reloading the page). The other is to use a JavaScript solution, as discussed in this question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.