cotonti.com : cache in tpl include.... seriously! https://www.cotonti.com Neueste Themenbeiträge Cotonti en Wed, 15 Oct 2025 14:28:47 -0000 Macik #36683 tensh:

Yeah, you're right, but I have to know the values and so the whole thing isn't dynamic. :(

 

Can you explain your case more detailed ?  Why you need dynamic and how you are using it?

]]>
Do, 03 Jan 2013 12:59:48 -0000
Trustmaster You can just disable tpl cache then if having dynamic includes is so important.

]]>
Do, 03 Jan 2013 11:26:58 -0000
tensh Yeah, you're right, but I have to know the values and so the whole thing isn't dynamic. :(

]]>
Do, 03 Jan 2013 10:05:43 -0000
Macik 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:

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

and then in file use IF blocks:

<!-- IF {PHP.pag.page_MYEXTRAFIELD} == 'some value' -->
  you template here
<!-- ENDIF -->
<!-- IF {PHP.pag.page_MYEXTRAFIELD} == 'other value' -->
  you second template here
<!-- ENDIF -->

 

]]>
Mi, 02 Jan 2013 15:06:24 -0000
tensh Hi;

I can't stand the caching in tpl file include. The code like this:

{FILE "./themes/{PHP.cfg.defaulttheme}/inc/{PHP.pag.page_MYEXTRAFIELD}"} doesn't work since the values are cached and aren't dynamic.

Not to mention that the code:

{FILE "./themes/{PHP.cfg.defaulttheme}/inc/{PAGE_ANYTAG}"}

doesn't work at all since {PAGE_ANYTAG} is empty.

Can you please give me any fix/solution? I wanted to include a template based on extrafield value (path), and I'm in a serious trouble now.

]]>
Mi, 02 Jan 2013 14:12:52 -0000