[Typo3] Can I set two attributes for a image?(TV)

Christopher bedlamhotel at gmail.com
Mon Aug 15 17:01:21 CEST 2005


Hi,

On 15/08/05, Martin Wan <mwan at objectivasoftware.com> wrote:
> Hi all,
> 
> I set two attributes for an image, but it does not work.
> 
> One attribute is ATTR:src, the other is ATTR:href.
> Below is the html code:
> <img src="images/arrow-red.gif" width="27" height="13" href="#">
> 
> The result is become:
> <img src="<a href="http://www.typo3.org" target="_top">www.typo3.org</a>"
> width="27" height="13" href="http://www.typo3.org" />
> 
> I don't know why? Does TV not permit set two or more attributes for an
> image?
> Could anyone please give me some hints?
> 

Well, the fist thing I notice is that you've got a 'href' attribute on
an img element. 'href' is NOT an attribute that can be used for img
elements [1].

In any case, TV apparently works this way _by design_. See Kasper's
answer to my (identical) question [2].

The method to achieving what you want is to basically map the img to a
Typoscript object (as shown in the FTB tutorial) and create an
unmapped extra field for each extra attribute that you nead. This will
create fileds for the attribute values in your FCE that can be
accessed by Typoscript.

-Christopher

-Christopher

[1] http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.2
[2] http://typo3.org/documentation/mailing-lists/dev-list-archive/thread/49714/?tx_maillisttofaq_pi1%5Bmode%5D=3



More information about the TYPO3-english mailing list