Create a new custom SQL query in prepareQuery().
The only thing to add is to set the state var to switch the query. Follow the way the VIEW is doing it to choose its correct layout query.
Coding is now a piece of cake
The administrator has disabled public write access.