[TYPO3-english] Display typolink only if not empty

Xavier Perseguers xavier at typo3.org
Mon Jan 27 13:38:54 CET 2014


Hi Sai,

> Thank you very much for reply. I have somehow used the snippet provided
> by you but could not succeed.
> I am new to typo3 & templavoila. :) Below is my code for the typolink.
> 
> <field_banner_link type="array">
>                 <type>attr</type>
>                 <tx_templavoila type="array">
>                     <title>Banner Link</title>
>                     <sample_data type="array">
>                         <numIndex index="0"></numIndex>
>                     </sample_data>
>                     <eType>link</eType>
>                     <tags>a:attr:href</tags>
>                     <TypoScript>
>                     10 = TEXT                   
> 10.typolink.parameter.current = 1
> 10.typolink.returnLast = url
> </TypoScript>
> 
> Can you please post me where should I modify the types?

This would be in this <TypoScript> section but as I understand you want
to remove the "<a href" altogether? This it won't work like that since
you are mapping a link to the "href" attribute, meaning the "<a href" is
always written (it's part of your template) regardless of whether you
did specify a link or not (if so you will have '<a href="" ...>' and
probably see the "button" in frontend.

It that's the problem, then you shouldn't map to href but create a whole
"<a" link with TemplaVoilà, for instance basically mapping to the <a>
instead of attribute-mapping to href and remove "10.typolink.returnLast
= url" to get a full link.

HTH

-- 
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-english mailing list