Just thinking (on the subject of the multi language site approach KK has helped me with - viewtopic.php?f=8&t=74&p=10934#p10934 ) that it may be useful to have Preload Replace functionality like this [http://ellislab.com/expressionengine/user-guide/templates/globals/preload_replacement.html
I can see benefit in a multilang site because if we could check a session / variable and feed it into a preload replace then rather than having to stack conditionals like this:
which works fine for simple fields, instead we would do something like:
because been able to do something like this (or even simply place a variable in a <cms:show />) means we could "tag" on the end of every field in a page thus no need to wrap them all with conditional statements like below:
I can see benefit in a multilang site because if we could check a session / variable and feed it into a preload replace then rather than having to stack conditionals like this:
- Code: Select all
<cms:if my_lang='en'><cms:show content_en /></cms:if>
<cms:if my_lang='fr'><cms:show content_fr /></cms:if>
<cms:if my_lang='es'><cms:show content_es /></cms:if>
<cms:if my_lang='de'><cms:show content_de /></cms:if>
which works fine for simple fields, instead we would do something like:
- Code: Select all
<cms:preload_replace variable_name="replacement">
<cms:show content_"replacement" />
because been able to do something like this (or even simply place a variable in a <cms:show />) means we could "tag" on the end of every field in a page thus no need to wrap them all with conditional statements like below:
- Code: Select all
<h1><cms:if my_lang='de'><cms:show tagline_de /></cms:if></h1>
<p><cms:if my_lang='de'><cms:show content_de /></cms:if></p>
<h1><cms:if my_lang='es'><cms:show tagline_de /></cms:if></h1>
<p><cms:if my_lang='es'>cms:show content_es /></cms:if></p>
ExpressionEngine allows you to assign text to be replaced prior to a template being parsed, to save time typing and editing certain bits of text that might get used multiple times. Preload Replacements act as a straight string replacement for use later in the same template.
Assignment and replacement occurs instantly when the template is loaded, before any tags are parsed, and therefore may not be affected by the result of another tag’s output.