[TYPO3] dynamic text replacement based on domain

Tyler Kraft tyler.kraft at netefficiency.co.uk
Thu Nov 15 17:58:32 CET 2007


If it works then go with it. ;-)

You don't need the [end] after each one, just throw a [global] after the 
last one.

and if your using css styled content to render everything then this line 
should do it:

tt_content.text.20.parseFunc.short. COMPANYNAME = Company A

And yes they refer to any page content thats a TEXT content type. So if 
you wnated to do it the saem way for bullet or table content types as 
well you'd need to possibly add another line for each one

You can shorten it all to:

[globalString = IENV:HTTP_HOST = *companyA.com]
tt_content.text.20.parseFunc.short. COMPANYNAME = Company A
[globalString = IENV:HTTP_HOST = *companyB.com]
tt_content.text.20.parseFunc.short. COMPANYNAME = Company B
[globalString = IENV:HTTP_HOST = *companyC.com]
tt_content.text.20.parseFunc.short. COMPANYNAME = Company C
[global]

hth




Daniel Mark wrote:
> Thanks! Does this look right then? It's working and providing the 
> behavior I need..
> 
> 
> page = PAGE
> page.10 = USER
> page.10.userFunc = tx_templavoila_pi1->main_page
> 
> [globalString = IENV:HTTP_HOST = *companyA.com]
>  tt_content.text {
>   20 = TEXT
>   20.field = bodytext
>   20.parseFunc {
>    short {
>     COMPANYNAME = Company A
>    }
>   }
>  }
> [end]
> [globalString = IENV:HTTP_HOST = *companyB.com]
>  tt_content.text {
>   20 = TEXT
>   20.field = bodytext
>   20.parseFunc {
>    short {
>     COMPANYNAME = Company B
>    }
>   }
>  }
> [end]
> ...snip..
> 
> 
> The only part that's unclear to me is the setup for parseFunc. Are those 
> few lines basically referencing any text pagecontents and providing a 
> handle to process parseFunc on? Maybe there's a shorter|better way to do 
> that..
> 
> Daniel
> 
> 
> 
> On Nov 15, 2007, at 5:57 AM, Tyler Kraft wrote:
> 
>> A few lines of TS is all you need.
>>
>> ok well you can use the domain as a condition like this in the template
>> setup:
>> [globalString = HTTP_HOST= *typo3.com]
>>
>> [globalString = HTTP_HOST= *anotherdomain.co.uk]
>>
>> [global]
>>
>> and then use the "short" property of parseFunc within those conditions
>> and have it replace all occurances of COMPANYNAME in your content.
>>
>> hth


More information about the TYPO3-english mailing list