[TYPO3] TS: condition for dataWrap in headers

Christopher bedlamhotel at gmail.com
Sat Oct 7 20:23:09 CEST 2006


Hi,

On 10/7/06, Bert Hiddink <hiddink at bendoo.com> wrote:
> Hello!
>
> I have the following TS:
>
> tt_content.stdWrap.innerWrap.cObject.123.dataWrap = <div
> class="tx-contentwrapper_style123"><a
> href="index.php?id={field:header_link}" class="bannerlinks"> | </a></div>
>
> Here, {field:header_link} gives me the id of the page where the header
> is linked to. However, the wrap '<a
> href="index.php?id={field:header_link}" class="bannerlinks">' is not
> correct in case the header is linked to an external page
> ("www.something.com"). In the latter case, this should be '<a
> href="http://{field:header_link}" target="_new" class="bannerlinks">'
>
> How could I set a condition in TS which checks the type of link
> (internal or external) and then change the wrap accordingly?
>
> Many thanks in advance as usual!!!


The short answer would be 'use typolink,' but can you elaborate on
what you're trying to achieve? tt_content.stdWra.innerWrap... is used
for wrapping /content elements/ and can be accessed from the 'frame'
selector in e.g. text content elements. The problem is that if you
wrap a content element in a link (as your code sample tries to do),
you create invalid html.

What's the actual goal you need to achieve?

-Christopher



More information about the TYPO3-english mailing list