[TYPO3-templavoila] String substitution

Xavier Perseguers typo3 at perseguers.ch
Tue Jan 6 07:16:43 CET 2009


Hi Christian,

> I've looked in the documentation, but couldn't find an answer to this -- 
> I assume -- rather simple question.
> 
> In normal Typo3 templates, I can substitute part of text in my template 
> file. For example, for copyright information, I could replace this 
> string (from my template file): ###COPYRIGHT###
> 
> by adding, in my setup field:
> 
> page.10 = TEMPLATE
> page.10.marks.COPYRIGHT = TEXT
> page.10.marks.COPYRIGHT.value = blablabla
> 
> (I may forget some stuff, but you understand the idea)
> 
> I can I do that with a Templavoila template?  As page.10 is not defined 
> the same way, I would think that the whole thing is different....

The process with TemplaVoila is a little bit different but not so much.

As for any other TV template, you have to somehow enclose the text you 
wish to replace in your template. Eg.

<p>Copyright ... blablabla</p>

You should (but must not) give an id to the enclosing item. This helps 
TV to keep the mapping work even if you modify your template. Eg.

<p id="copyright">Copyright ... blablabla</p>

Then in TV itself, you create a new item in your datastructure. Element 
type is typically "Element" and editing type is TypoScript Object Path. 
Upon saving you get a new textbox showing the Object path. Change the 
default value to something meaningful such as lib.copyright. Save again 
and map it the standard way to your <p> tag.

Now you just have to provide the TS for your copyright:

lib.copyright = TEXT
lib.copyright.value = blablabla

That's it!

The same is true for the menu (even if there is a wizard for this), a 
breadcrumb menu, ...


-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-templavoila mailing list