Cotonti / Cotonti

Fast, reliable and flexible PHP CMF/CMS
https://www.cotonti.com
BSD 3-Clause "New" or "Revised" License
92 stars 51 forks source link

Custom templates for parent sections in forums #1769

Open webitproff opened 4 months ago

webitproff commented 4 months ago

We can create and connect custom templates for the "parent" sections of the forum by adding a small piece of code after the hook in line 170 in the file forums.sections.php .

Here is the code:

$mskin = cot_tplfile(array('forums' ,'sections', Cot::$structure['forums'][$c]['tpl'])); $t = new XTemplate($mskin);

During the experiment, a custom template was connected to obtain information about the template name, as an example of "forums.sections.cotonti.tpl", which can be customized in the same way as it is implemented with lists of pages - "page.list.news.tpl", "page.list.system.tpl", etc.

webitproff commented 4 months ago

solved by plugin via hook forums.sections.main

Alex300 commented 4 months ago

It can be usefull. Will make it like in Page module:

$mskin = cot_tplfile(array('forums' ,'sections', Cot::$structure['forums'][$c]['tpl']));

/* === Hook === */
foreach (cot_getextplugins('forums.sections.main') as $pl) {
    include $pl;
}
/* ===== */

$t = new XTemplate(cot_tplfile($mskin));