Module template – it is a set of files in the folder modules/module_name/views.
Module templates are responsible for the design of a modular display information in the main content area of the site. This lists the news, products, files, photos, as well as individual article pages, card products, blocks of Polls, feedback form, etc.
Typically, the module template files as follows:
Example:
Online store catalog front page template will file modules/shop/views/shop.view.first_page.php, and a list of news – modules/news/views/news.view.list.php.
Making the appearance of the product cards in the file modules/shop/views/shop.view.id.php.
A design feedback forms will be in the template modules/feedback/views/feedback.view.form.php.
The module template may be other files that reflect the individual characteristics of his appearance.
Example:
If you want to change the appearance of the block surveys on the site, then you need to make changes to the template module polls: modules/votes/views/votes.view.show_block.phpIncluding the template is as follows:
Example:
echo $this->diafan->_tpl->get('template_name', 'module_name', $result);
where $result
– passed to the data in an array pattern.
The template to call another template, you can use the short form:
Example:
echo $this->get('template_name', 'module_name', $result);
The template can cause the module template tag. For this purpose it is necessary to process function htmleditor()
.
Example:
echo $this->htmleditor('<insert name="show_block" module="site" id="13">');
Also, all data entered via the visual editor, you want to handle with this function.
Example:
// in file modules/news/news.model.php
$row["text"] = $this->diafan->_tpl->htmleditor($row["text"]);