[TYPO3-templavoila] Optional Link

Dmitry Dulepov dmitry.dulepov at gmail.com
Mon Jul 20 15:30:27 CEST 2009


Hi!

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.

As I said, if you know what "required" property does, than you know the answer. It looks like it needs more explanation if the question is still not solved...

Here is a description of the "required" property from TSRef:
================
This flag requires the content to be set to some value after any content-import and treatment that might have happend now (data, field, current, listNum, trim). Zero's is NOT regarded as empty! Use "if" instead!

If the content i empty, "" is returned immediately.
================

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.

> And what about my second question: would it be a good change to let TV
> add the required=1 by default?

No, because it limits the functionality.

-- 
Dmitry Dulepov
LinkedIn: http://www.linkedin.com/in/dmitrydulepov
Twitter: http://twitter.com/dmitryd
Skype: liels_bugs


More information about the TYPO3-project-templavoila mailing list