sitecore - In xslt, select item with id, which value is in variable -


i have item id variable. , in apply template want select item id. how can it? i've tried this, doesn't work:

<xsl:variable name="myid">    <xsl:value-of select="sc:fld('field',.,'id')"/> -//(this item id) </xsl:variable>       <xsl:apply-templates mode="summary" select="sc:item('$myid',.)" /> 

thanks in advance.

you should not enclose variable reference in quotes:

<xsl:apply-templates mode="summary" select="sc:item($myid,.)" /> 

note can set value of variable directly this:

<xsl:variable name="myid" select="sc:fld('target',.,'id')"/>  

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -