Forums / Cotonti / Core Labs / page templates idea

Macik
#38058 2013-09-29 20:47
#38050 Twiebie:

Pfff, I've had this problem with several client websites where I wanted to use the system category for multiple pages with different TPL's.

Glad I stumbled upon that bit of code, guys!

Thanks.

Make a simple plugin. hook it on `page.main`. Code it as follows:

if ($cat['tpl'] == 'system') {
  $mskin = cot_tplfile(array('page', $cat['tpl'], empty($al) ? $id : $al));
}

use templates named as: `page.system.#alias.tpl` or `page.system.#id.tpl`  (where #alias and #id is alias or id of corresponding page), located in standard page.tpl folders.

Note1: be sure to use alias if it exists for current page
Note2: be sure not to use special symbols in page alias that can not be used as file name symbols

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F