Overriding a template from detailview, listview or editview:
1. Create a directory called /modules/<YOUR_MODULE>/views
2. Create the file /modules/<YOUR_MODULE>/views/view.list.php
You can change list to detail or edit, to another view.
3. Put the following code on view.list.php
4. Create a file ListViewGeneric.tpl in /custom/modules/<YOUR_MODULE>/tpls.PHP Code:<?php
require_once('include/MVC/View/views/view.list.php');
class <YOUR_MODULE>ViewList extends ViewList{
function <YOUR_MODULE>ViewList(){
parent::ViewList();
}
function display(){
parent::display();
}
function listViewProcess(){
$this->processSearchForm();
$this->lv->searchColumns = $this->searchForm->searchColumns;
if(!$this->headers)
return;
if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
//here we are overriding with your custom template, in my case I just modified ListViewGeneric.
$this->lv->setup($this->seed, 'custom/modules/<YOUR_MODULE>/tpls/ListViewGeneric.tpl', $this->where, $this->params);
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
echo get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
echo $this->lv->display();
}
}
}
?>
You can copy the original template from /include/ListView/ListViewGeneric.tpl
Here you can modified the template in many ways.
Enjoy it.


LinkBack URL
About LinkBacks



Reply With Quote




Bookmarks