[TYPO3-mvc] More magic wishes: Nested viewhelpers?

Xavier Perseguers typo3 at perseguers.ch
Mon Jun 1 11:11:07 CEST 2009


Hi Susanne,

Susanne Moog wrote:
> Hi everyone,
> 
> today seems to be my "wish" day *g*. I want to get the following to work:
> 
> <f:image
> src="typo3conf/ext/addresses/Resources/Private/Icons/v-vcard.png"
> alt="<f:translate key="download_vcard">Download as vCard</f:translate>"
> maxWidth="140" />
> 
> You see that I want to get a translated alt text from a language file.
> The above obviously doesn't work. Do you have an idea what could work?

I've no idea but just an information. XSLT solves this issue by allowing 
attributes to be defined as elements:

<a>
    <xsl:attribute name="href">
       <xsl:text>http://www.amazon.com/exec/obidos/ASIN/</xsl:text>
       <xsl:value-of select="@isbn"/>
    </xsl:attribute>
    <xsl:value-of select="title"/>
</a>

In this case it's easy as it outputs XML and this is not the case in 
Fluid but perhaps something in this direction could be done. Because 
your case would be quite easy to tackle with but I could imagine more 
complicated scenarios where your "alt" attribute would be the result of 
a test...

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-typo3v4mvc mailing list