Форуми / Cotonti / Support / cache in tpl include.... seriously!

Macik
#36678 02.01.2013 15:06

Similar question had been discussed somewhere on forum… You can not use «dynamic» FILE statments. 

As a solution bring template logic to your TPL files rather creating separate TPL files for any case. So you need to include one file:

XML/XHTML
1
{FILE "./themes/{PHP.cfg.defaulttheme}/inc/extrafields.tpl"}

and then in file use IF blocks:

XML/XHTML
1
2
3
4
5
6
<!-- IF {PHP.pag.page_MYEXTRAFIELD} == 'some value' -->
  you template here
<!-- ENDIF -->
<!-- IF {PHP.pag.page_MYEXTRAFIELD} == 'other value' -->
  you second template here
<!-- ENDIF -->

 

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