简体   繁体   English

Umbraco:如何使用多节点树选择器修复流内容?

[英]Umbraco: What can I do to fix my stream content with Multiple Node Tree Picker?

I'm looking for a correct way to use the 'Multiple Node Tree Picker'. 我正在寻找使用“多节点树选择器”的正确方法。 I installed the package, created a data type with it, then I wrote a Macro and I can use the drag and drop feature to choose what pages I want to show in the Homepage (from the Featured Articles Section of my website), but it doesn't show anything. 我安装了程序包,并使用它创建了数据类型,然后编写了宏,然后可以使用拖放功能选择要在首页中显示哪些页面(来自网站的“特色文章”部分),但是什么也没显示。 Clearly, I've did something wrong in the Macro (XSLT), I don't know so much about XSLT. 显然,我在宏(XSLT)中做错了什么,我对XSLT不太了解。 Thanks. 谢谢。

<xsl:param name="currentPage"/> 
  <xsl:template match="/"> 
    <xsl:if test="$currentPage/articlePicker/MultiNodePicker/nodeId"> 
      <xsl:for-each select="$currentPage/articlePicker/MultiNodePicker/nodeId"> 
        <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(1144)" /> 
        <a href="{umbraco.library:NiceUrl(.)}"> 
        <xsl:value-of select="$node/@nodeName" /> 
        </a> 
      </xsl:for-each> 
    </xsl:if> 
  </xsl:template> 
</xsl:stylesheet>

try this ..... 尝试这个 .....

<xsl:param name="currentPage"/> 
  <xsl:template match="/"> 
    <xsl:if test="count($currentPage/articlePicker/MultiNodePicker/nodeId) &gt; 0"> 
      <xsl:for-each select="$currentPage/articlePicker/MultiNodePicker/nodeId"> 
        <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(current())" /> 
        <a href="{umbraco.library:NiceUrl($node)}"> 
        <xsl:value-of select="$node/@nodeName" /> 
        </a> 
      </xsl:for-each> 
    </xsl:if> 
  </xsl:template> 
</xsl:stylesheet>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在umbraco节点的一个选项卡中访问所有属性? - How can I access all the properties in one tab in an umbraco node? 我可以做些什么来使我的C#应用​​程序利用多个处理器内核? - What can I do to make my C# application take advantage of multiple processor cores? 我无法将“firstplace”等打印到 .net forms 中的文本框,我该怎么做才能解决这个问题? - I cannot get the "firstplace" etc to print to textbox in .net forms, what can i do to fix this problem? 什么是 NullReferenceException,我该如何修复它? - What is a NullReferenceException, and how do I fix it? 什么是 IndexOutOfRangeException / ArgumentOutOfRangeException,我该如何解决? - What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it? 我可以在同一个Stream上使用多个BinaryWriters吗? - Can I use multiple BinaryWriters on the same Stream? 什么是ExtendedSocket异常,我该如何解决? - What is ExtendedSocket exception and how can I fix it? 我需要安装nuget才能与umbraco一起使用吗? - DO I need to install nuget to work with umbraco? 在阅读写入内容之前,我是否需要“回放”一个流? - Do I need to 'rewind' a stream before reading what was written to it? 为什么我的stream在我自己动手之前就被解锁了? - Why my stream is unlocked before I do it myself?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM