Forum categories

Пользовательские шаблоны для родительских разделов на форумах

Модуль "Forums". Как в Cotonti создать и подключить свои собственные шаблоны (макеты страниц) родительских категорий для отображения на сайте.

webitproff
webitproff • 2024-02-13 12:25 #29

Alex300 добавил в планы на релиз  0.9.25 внести измения и сделать подобно как в модуле Pages:

$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));

а пока, это можно сделать через собственный маленький плагин с хуком:

<?php
/* ====================
  [BEGIN_COT_EXT]
  Hooks=forums.sections.main
  [END_COT_EXT]
  ==================== */

defined('COT_CODE') or die('Wrong URL');

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

 

This post was edited by Administrator (2024-02-13 12:29, 2 years ago)
🗿

🧙‍♂️ Well met, good traveler! Fate has guided your steps to our humble realm. Here, wise sages and masters of the coding craft ⚒️📜 gather to unravel the mysteries of the code ✨⚙️, share their knowledge, and add new chapters to our chronicles.
⬅️ To the left lie ancient scrolls 📚 filled with forgotten wisdom. ⬆️ Straight ahead, friendly folk offer counsel 💬 to those in need. ➡️ To the right, you may become a chronicler ✍️ yourself, sharing your craft and leaving words of wisdom for those yet to come.
📝 Delay no longer—tell us the name by which you are known, complete the rite of registration 🛡️, and join our fellowship!
🏰 Our brotherhood holds no secret initiation, yet many halls remain closed to wandering guests, for some knowledge 💎 is reserved for those who choose to walk this path beside us.