How to construct additional views

I am trying to construct an alternative (not replacement) list view, with, initially at least, just a different set of fields.

I have added a new action in Menu,php, then added in the controller the function action_index1() { $this->view = “list1” }

Then in the “views” subdirectory, I have copied view.list.php to view.list1.php and added some test display text to the latter.

So far so good - both index views appear in the top menu, both load the view as before, and the new one shows the test text.

However, I am now stuck - in the metadata I copied listviewdefs.php to list1viewdefs.php and commented out some of the fields. This makes no difference - both views show the original fields.

Have I got something wrong - or barking up the wrong tree altogether? Any advice appreciated.

Solved the mystery - not unsurprisingly the problem was my lack of understanding! Having copied listviewdefs.php to list1viewdefs.php, I somewhat naively thought that I needed to change the variable name to $list1viewdefs, so of course when a subsequent script “included” the viewdefs, it was still referring to the original variable. I also found that in the new sub-classed ViewList, I had to set $this->type = “list1”.

I have now got some way down the line to creating custom views. It would be nice to see some more coherent documentation on this, as for me the essence of a MVC system is the separation of its three elements and the aim of being able to write new views without having to understand too much about the model/controller logic.

I am also working on creating custom edit views. Do you have any documentation and hints to get me started? I am trying to change the display method and that’s probably not the correct way of doing things. Any help would be appreciated!