[TYPO3-english] Display page title in page

bernd wilke t3ng at bernd-wilke.net
Wed Jul 9 16:59:51 CEST 2014


Am 09.07.14 14:59, schrieb armin otto:
> thanks for the pointers.
>
> I tried to set a variable in TS and render it. And it works ... up to a
> point.
>
> in page.ts I have a lines like
>   page.variables.p1.value = Some Text  lib.variables.l1 = TEXT
>   lib.variables.l1.value = Some other Text
>
> and in the header.html I have
>
>   <p> {v:var.typoscript(path: 'page.variables.p1.value')} </p>
>   <p> <f:cObject typoscriptObjectPath="lib.variables.l1"/> </p>
>
> Both methods work to put out the specified text on the screen, but I am
> not able to fill the p1 or l1 variables with something as mundane as a
> page title. If I try something like page.variables.p1.value = page.title
> , all I get rendered is the string "page.title".

don't hamper with additional viewhelpers if you have the data in a variable!
And the last line shows your lacks in understanding typoscript.

So:
you need to learn a little bit more of typoscript.


> And I know that the page title is available somehow in header.html,
> because of this line:
>   <f:debug>{_all}</f:debug>
>
> It shows me the page object right at the top and it contains everything
> I want.
>
> So how do I convince Typo3 to render the page title ?

||: you need to learn a little bit of fluid-templating. :||

all you can see with
<f:debug>{_all}</f:debug>
are fluid-variables you can use at once.
you just need to decipher the correct path from the output which 
sometimes is complicated but mostly very easy.

if you can see the value in the debug-output just build up a full 
qualified variable like
{data.title}
Variables are enclosed in curly brackets.
without namespace.
and viewhelpers are needed just in case the format of the data has to be 
changed.



bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list