[Typo3] Syntax problem with TS and {page:uid}

Ralph Brugger news.netfielders.de at public.linkpool.de
Sun Nov 20 10:27:58 CET 2005


Hi Christopher,

first of all: Great work & great explanation!

>>The value of "{page:uid}" won't be set used as part of the link, but the
>>text "{page:uid}" is used.
>>
>>What am I doing worng?

> You'll need to do a little research into .stdWrap and datatypes.
> Here're the urls of two longish posts I've made on the subject in
> answer to similar questions:
> Message 2 of:
> http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/110181995/?tx_maillisttofaq_pi1%5Bpointer%5D=14&tx_maillisttofaq_pi1%5Bmode%5D=1
> Slightly different problem, same solution:
> http://lists.netfielders.de/pipermail/typo3-english/2005-August/010891.html
> 
> To summarize, you need to:
> 1. Find out what datatype might be useful to provide the information
> you need from the datatype reference [1] (hint: probably it will be
> 'gettext'),

OK. I've had a look at the data types. I hope that I underestand for now.

> 2. Make sure that the property you're using (in this case, it's the
> IMAGE object's '.wrap' property) has the '->stdWrap' datatype (because
> TS objects rarely implement the 'gettext' datatype directly, but many
> .stdWrap objects do...)

Maybe the online documentation is a bit to widespread for a beginner.
I've started with an german book "typo3 Praxiswissen" where I can't find
those informations.
I see, I'll have to deal more with the online documentations!

> 3. Find an appropriate .stdWrap property
> In the case you've shown above, you're trying to wrap an image in a
> link where the href attribute is dynamically set--but when you consult
> the TSref [3], you find that no property of the IMAGE object has the
> 'gettext' datatype. However, the .stdWrap property has the '->stdWrap'
> data type.

OK. Now I understood!

> Furthermore, looking at the examples on the stdWrap page in the TSref
> [2], you'll see that the stdWrap property you're trying to use above
> is called .dataWrap. Fom this, you might conclude that what you need
> is this [abbreviated sample]:

OK, I found this hint in the TSRef:
http://typo3.org/documentation/document-library/doc_core_tsref/stdWrap/
dataWrap -> "The content is parsed for sections of {...} ..."
That's exactly what I was looking for.

> lib.headerDown = IMAGE
> lib.headerDown {
>   stdWrap.dataWrap = <a href="index.php?id={field:uid}&print=1&no_cache=1">|</a>
> }

OK, that's the solution - great!

> This _will_ wrap your image in a link, but it might be unsatisfactory
> since the url will _not_ change if you're using RealURL to create
> links such as http://www.example.com/foo/bar/ or if you're using
> 'simulateStaticDocuments' to create urls like
> http://www.example.com/foo.html.
> But if you browse through the stdWrap part of the TSref long enough,
> you will eventually come on a property called .typolink (about which,
> more information at [4]). This object can be used to create what you
> might call 'Typo3-friendly' links (i.e. links that'll change if you're
> using any link-manipulating features or extensions). You could use
> typolink to create the same link as above this way:
> lib.headerDown = IMAGE
> lib.headerDown {
>   stdWrap.typolink {
>     parameter.data = page:uid
>     additionalParams = &print=1&no_cache=1
>   }
> }

Again: Superb ;)

Thanks a lot for your suggestions!

Ralph



More information about the TYPO3-english mailing list