1
<xsl:for-each select="$home/item">
<sc:text field= "Title"/><br/>
</xsl:for-each>
我在Home,“about”和“start”里面有两个模板,上面的代码在Title字段中显示两个数据,我只想显示标题字段“about”。 。 我该怎么做?Sitecore XSLT渲染
<xsl:for-each select="$home/item">
<sc:text field= "Title"/><br/>
</xsl:for-each>
我在Home,“about”和“start”里面有两个模板,上面的代码在Title字段中显示两个数据,我只想显示标题字段“about”。 。 我该怎么做?Sitecore XSLT渲染
有很多事情可以做。如果它只是要显示的“约”(而不是更多),则可以定义一个变量。例如,您可以查看标准Sitecore渲染的顶部(或查看您的变量的定义)。
<xsl:variable name="aboutItem" select="/sitecore/content/home/about" />
然后你就可以拿到冠军,像这样:
<sc:text field= "Title" select="$aboutItem" />
不要从我的头顶记住,如果sc:text
需要select
财产或财产item
。
[编辑]
只给你的另一种方式的点子它也可以:
<xsl:for-each select="$home/item[@id='guid of your about item']">
<sc:text field= "Title"/><br/>
</xsl:for-each>
感谢,它的工作 – sclang 2013-04-22 08:26:40