[TYPO3-templavoila] Optional Link

Chris Bernhard chris at dreamride.de
Sun Jul 26 20:41:28 CEST 2009


Jigal van Hemert schrieb:
> Hey Dmitry,
> 
> Dmitry Dulepov wrote:
>> Jigal van Hemert wrote:
>>> This will produce the URL. If this is mapped to the href-attribute
>>> of an A-tag in the HTML template it's not obvious for me whether TV
>>> will actually remove the A-tag if there is no URL or not. Your
>>> answer suggests that TV is clever enough to remove the A-tag in such 
>>> a situation.
>>
>> It doesn't. TV does not remove anything.
> 
> Glad it doesn't. I lik to be in control ;-)
> 
>> Now think what will happen if you map only the attribute of the A tag
>> and use the "required" property? Will the whole tag be removed? Of
>> course, not. Only the attribute's value will be removed.
>>
>> You need to map the whole tag, not the attribute.
> 
> If you have a FCE with a field for a link text (or image or whatever) 
> and a link field, then it would be logical to me to map the link text to 
> the A-tag (INNER) and the link field also to the A-tag (ATTRIBUTE href).
> 
> A link field in an FCE only allows me to set the URL/page id/file 
> name/etc. and not the contents of the link (text/image/etc.)
> 
> To make the link (A-tag) optional I would map the link text to the A-tag 
> (OUTER) and make the link field unmapped. With some extra TS you can 
> make an optional link.
> 
> I think that the OP wanted to have an optional link in such a way. (What 
> a confusion :-) )
> 
> Regards,
> 

Hi @ all,

okay, was a little confused but now all thinks are working fine for me.
Did it with an not mapped link and the rest with an if statement in the 
typoscript of the DS :-)

Thanks a lot for helping me,

Chris


More information about the TYPO3-project-templavoila mailing list