[TYPO3] TS variables and string concatenation

JoH asenau info at cybercraft.de
Tue Oct 31 15:39:58 CET 2006


> I have an area on my website for the page title.
>
> lib.HeadLine = TEXT
> lib.HeadLine.data = page : title
>
> I would like to show the title of the current page and the page in the
> upper level, something like this:
>
> upperLevelPageTitle - thisPageTitle
>
> To get the upper level I use this:
>
> titlelevel : -2
>
> How do I concatenate these objects?
>
> I have tried playing with variables:
>
> $firstHeader = titlelevel : -2
> $secondHeader = page : title
> lib.HeadLine = TEXT
> lib.HeadLine.data = {$firstHeader} - {$secondHeader}
>
> but the output is just {$firstHeader} - {$secondHeader}

TypoScript can't handle real variables.
$whatever is reserved for constants, that must be defined in the constants
section, but there you won't have stdWrap and getText available to do
something like "leveltitle".

But this isn't necessary anyway, since the easy solution is:

lib.HeadLine = TEXT
lib.HeadLine.dataWrap = {leveltitle: -2} - {page:title}

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com





More information about the TYPO3-english mailing list