cotonti.com : cache problems? https://www.cotonti.com Последние сообщения в теме Cotonti en Thu, 16 Oct 2025 17:43:52 -0000 tensh Yes I know, but it's all in header, and I want to avoid custom headers, I have an impression that site runs slower if custom headers are enabled.
I just made a lot of IFs, it looks so-so.

Thanks for help :)

]]>
пн, 22 окт 2012 11:22:25 -0000
Trustmaster For {PHP.c} differentiation use different templates instead: page.CAT.tpl and page.list.CAT.tpl.

]]>
вс, 21 окт 2012 06:31:26 -0000
tensh But sometimes I use {PHP.env.ext} and sometimes {PHP.c} so it's not that easy.

Thank you for help anyway. :)

]]>
сб, 20 окт 2012 19:22:37 -0000
Trustmaster <!-- IF {PHP.lang} == 'pl' --> {FILE "{PHP.cfg.themes_dir}/{PHP.theme}/inc/pl-{PHP.env.ext}.tpl"} <!-- ENDIF --> <!-- IF {PHP.lang} == 'en' --> {FILE "{PHP.cfg.themes_dir}/{PHP.theme}/inc/en-{PHP.env.ext}.tpl"} <!-- ENDIF -->

 

]]>
сб, 20 окт 2012 11:41:54 -0000
tensh Yeah, at first it was like that, but the template was very big and I think it will not be easy to maintain :/ (3 languages, 6 sections, each has different slideshow in different languages)
I guess I'll have to write a plugin.

]]>
сб, 20 окт 2012 09:41:34 -0000
GHengeveld It's probably easiest to use a single template for all languages, and use IF blocks within that template to show stuff for each language.

<!-- IF {PHP.lang} == 'pl' -->
Polish stuff
<!-- ENDIF -->
<!-- IF {PHP.lang} == 'en' -->
English stuff
<!-- ENDIF -->
]]>
сб, 20 окт 2012 08:31:29 -0000
tensh The output filepath was OK, but the template was cached to the last one used regardless of the language used.

So how should I include template based on language and location? Do I really have to write a plugin for it?

]]>
сб, 20 окт 2012 07:49:28 -0000
Trustmaster General advice: don't use dynamically calculated variables in tpl FILE statements. FILE statements are static, they are compiled once a template is updated and afterwards the cached template behaves like there is no FILE statement at all but rather the entire file contents stands in its place.

]]>
пт, 19 окт 2012 18:02:26 -0000
GHengeveld A wild guess, but perhaps you can try {PHP.usr.lang} instead of {PHP.lang}.

Also, you may want try outputting the filepath and see what it is before attempting to include it. This could give some insight.

]]>
пт, 19 окт 2012 15:03:27 -0000
tensh Hi;

I want to include a tpl based on location and lang.


This code works:

<!-- IF {PHP.env.ext} == "contact" AND {PHP.lang} == 'pl' -->	

		{FILE "{PHP.cfg.themes_dir}/{PHP.theme}/inc/pl-{PHP.env.ext}.tpl"}

<!-- ENDIF -->

but this one doesn't work:

<!-- IF {PHP.env.ext} == "contact" -->	

		{FILE "{PHP.cfg.themes_dir}/{PHP.theme}/inc/{PHP.lang}-{PHP.env.ext}.tpl"}

<!-- ENDIF -->

Why? The second one would be easier, now I have to repeat the same code for all 3 languages

]]>
пт, 19 окт 2012 13:39:03 -0000