I’ve created a template which builds the grid dynamically in dependence of how many pages are in the pagelist. For example, if there are 10 pages and the grid size is 3, there are 3 rows with 3 cells and the last cell in the fourth row expands to full width. The same for 11 pages: Grid size is 3, then 3 rows with 3 cells and the last row divided into two half-sized cells.
To realize that I have defined a bunch of variables: “parentPagelistCount” (for accessing the pagelist count in the foreach loop), “parentPagelistThreeColumns” (to determine if the desired grid size is two or three [toggled by checkboxPagelistThreeColumns]) and “gridSize” (which is calculated by some modulo etc.)
Now these variables aren’t intended for dashboard use as setting them would break the desired behavior. An alternative would be to write the specific template entirely in plain PHP, but that would be such a hacky way.
I think the best way would be to create a sort of a ignore key in the theme.json containing the field/checkbox/… names which should entirely be ignored in the dashboard. If any another theme uses the same variable, that have priority, otherwise Automad respects the ignores. This way no breakage of other themes would be guaranteed.
I hope my suggestion is understandable,
have a nice day