[TYPO3] dynamic text replacement based on domain

Daniel Mark dmark84 at gmail.com
Thu Nov 15 17:42:04 CET 2007


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