[TYPO3] dynamic text replacement based on domain
Daniel Mark
dmark84 at gmail.com
Wed Nov 14 23:55:20 CET 2007
I have several domains directed to the same site tree within Typo3. I
need to change instances of the company name within pagecontents
depending on which domain the user visits from.
Right now, I'm successfully using the stfl_replacer extension[1] to
replace those instances. (Thanks for the tip, Bartosz!) But I need to
dynamically configure the <replacement> tag based on domain, something
like this:
..snip..
<replace index="0">
<pattern><![CDATA[<companyName>]]></pattern>
[globalString = HTTP_HOST=www.companyA.com]
<replacement>Company A</replacement>
[end]
[globalString = HTTP_HOST=www.companyB.com]
<replacement>Company B</replacement>
[end]
</replace>
..snip..
Obviously I can't do conditions within my page TSconfig, so I need a
different strategy. I'm still new to Typo3 so I'm not sure how else to
approach this. [Is there a way I can set a global variable|constant
somewhere else and then reference it in my TSconfig?]
Any help would be appreciated, thanks!
Daniel
[1] http://typo3.org/extensions/repository/view/stfl_replacer/0.3.1/
More information about the TYPO3-english
mailing list