I’m getting a popup error when I lick on “ListView” of a custom module in Studio. The title of the modal error window is: “An error has occurred” and the content is:
if you edit (or create if it doesn’t exist) a file at custom/modules/YOURMODULE/views/view.list.php
anything you echo in the method preDisplay will be included near the start of the page so you can add javascript to the page this way. If you’re adding a new preDisplay method it’s worth remember you should probably still call the parent method like this parent::preDisplay() so all the default code runs.
Thanks for this - yes, I discovered that shortly after my post. I think it may be prudent for anyone else who needs to create such a file, that it should be in the following format:
<?php
/**
* @file
* custom/modules/[YOUR_MODULE_NAME]/views/view.list.php
*/
require_once('include/MVC/View/views/view.list.php');
class [YOUR_MODULE_NAME]ViewList extends ViewList {
public function __construct()
{
parent::ViewList();
}
function preDisplay() {
// Must have this otherwise it errors.
parent::preDisplay();
}
function display() {
// Must have this otherwise it errors.
parent::display();
}
}