[TYPO3] Replace code in template

Erik Bartoš erik.bartos at gmail.com
Tue Aug 26 22:02:50 CEST 2008


So I try to explain the problem once again, in more details...

The Templavoila extention works excelently. I know how to insert CSS  
styles, javascript functions, meta tags, in the template. The problem is  
that I cannot replace some HTML code from template by another code. What I  
mean by that...

By HTML code you can imagine everything in the template file, doesn't  
matter if it is in head or body part, examples:

1. ...function changeImagesArray(array) {input.data_/...
2. ...newImage('input.data_/input_27-over.gif');...
3. ...<td rowspan="5"><img src="input.data_/input_05.gif"...
4. ...<a onmousedown="changeImages('input_15',..., etc.

"Replace" means that some strings (characters) from template file, e.g.  
"input.data_" must to change to other strings (characters), e.g.  
"output.data_" in whole template. In javascript functions and also in  
<img> and <a> tags. It would be good, if it will be done by some simple  
TypoScript code.

Automaketemplate extention for this purpose has build in function, i.e.
elements.HEAD.str_replace.10 {
        value = 'input.data_
        replaceWith = 'output.data_
     }
which replace all occurancies of string "'input.data_" by string  
"'output.data_", everywhere in the template file header part (similar for  
body part). I want something similar also for Templavoila...

One possible usage of this procedure is, that when the template is  
designed, it's not clear how the filenames will be called, only finally,  
when the template for the site is completed, the right filenames are  
included.

Maybe whole template must be parsed by parseFunction, but I'm not so good  
in Typoscript, to do it effectively :-)

Erik Bartos


More information about the TYPO3-english mailing list