How do site and modules templates

The easiest way to deal with unknown algorithms relying on ready-made solutions. Take a list of news on the page DIAFAN.CMS standard design. The demo version of this page Category Tourism News.

View a sample page.

To understand how DIAFAN.CMS builds this page, you need to know two things:

  • Which template is used on the current page of the site
  • Which module is connected to the current page

As our page is Home/Useful/News, open the site pages and find it.

Site page

If you click on a page with an attached module, the first module will list elements. To determine which template is connected to the current page of the site, you need to open it to edit. To do this from the list of elements connected to the module page, you need to click change.

Page with connected module

Assigning a template – not the chastoispolzuemaya function, so it is moved to the section Additional properties. Open it.

Site page

You will see a template assigned to the page "News". In our case it is themes/site.php.

Site page

Further. As we consider the news from the "Tourism news" category, not the root to the news list, we need to know which patterns are assigned to this category. Select the category "Tourism news" over the news list, and then click change.

Editing page from the panel

If you have connected a quick edit panel, the current page to find much easier. Just click on the icon on the panel-pencil.

Site page

Category "Tourism news" will open for editing. Open Additional properties and see that for the category of inherited the main website template the themes/site.php, a module news module uses template modules/news/views/news.view.list.php.

Site page

Now you can safely open the file website template themes/site.php and template news module and make the necessary changes there. For clarity, we have shown links between formulaic tags and blocks online. And as pointed out in what file the right of each template tag.

How do site and modules templates

Open circuit original size

Attention!
In this section, the documentation refers to the standard and basic design templates site. It's themes/site.php, themes/site_start.php and others that are in the folder themes. As well as modules templates located at modules/module_name/views. However, if your site uses threads, resulting customization, website templates and modules, templates may be in a folder custom/theme_name/modules/module_name/views. More about topics.

And once again we give a link to a directory of [all of template tags]](/dokument/full-manual/templates-functions/).