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. |
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 -->
https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |
tensh |
|
---|---|
Yeah, you're right, but I have to know the values and so the whole thing isn't dynamic. :( |
Trustmaster |
|
---|---|
You can just disable tpl cache then if having dynamic includes is so important. May the Source be with you!
|
Macik |
|
---|---|
#36683 tensh:
Can you explain your case more detailed ? Why you need dynamic and how you are using it? https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |