sitecore - How to add image titles to sc:image extension elements -


i able add "title" variable images created using xslt. specifically, working file called "teasers.xslt" part of sitecore6 starter kit. text each title "teaser abstract" maintained in sitecore content editor.

my understanding can add new variable "showteaser" xsl template, can made query teaser abstract follows:

<xsl:variable name="title" select="sc:item(sc:fld('teaser abstract',.),.)" /> 

if correct, possible add new title variable property of images? below complete xsl template "showteaser" (from teasers.xslt) insert new title property:

<xsl:template name="showteaser">     <xsl:param name="teaser_item" />     <xsl:variable name="teaser" select="sc:item($teaser_item,.)" />     <xsl:variable name="teaser_link" select="sc:item(sc:fld('teaser link',.),.)" />     <sc:link field="teaser link" select="$teaser">       <sc:image field="teaser image" select="$teaser" class="photo-border" w="200" h="100" as="1" bc="white" />     </sc:link>     <h2>       <sc:link field="teaser link" select="$teaser">         <sc:text field="teaser title" select="$teaser" />       </sc:link>     </h2>     <p>       <sc:memo field="teaser abstract" select="$teaser" />     </p>     <div class="read-more-link">       <sc:link field="teaser link" select="$teaser">         <sc:text field="text" select="$readmore" />       </sc:link>     </div>   </xsl:template> 

i have tried adding title variable sc:link no success. assumption how go way off base? in advance, appreciated!

you solved problem now, benefit of future users:

it seems have put title attribute inside -tag . can using attribute value template. is, putting expression inside curly backets:

<sc:image field="teaser image" select="$teaser" class="photo-border" w="200" h="100" as="1" bc="white" title="{sc:fld('teaser abstract',.)}" /> 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -