次のコンテンツ構造があります
=Main Home Node
-Child Node 1
-Child Node 2
-Child Node 3
- - Sub Node 1 of Child 3
- - Sub Node 2 of Child 3
- - Sub Node 1 of Child 3
-Child Node 4
Richtext Editor(Name = sectionBody) である Child Node の内容をレンダリングしています。次の XSLT コードで子ノードをレンダリングします。
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<h2 class="section-title text-center wow fadeInDown"><xsl:value-of select="sectionHeading"/></h2>
<div class="row">
<xsl:value-of select="umbraco.library:Item($currentPage/@id,'sectionBody')" />
</xsl:for-each>
</div>
</xsl:for-each>
今、子ノード 3 のサブノードを含むレンダリングのために、子ノード 3 のリッチテキスト エディターでマクロを呼び出しています。
以下は、リッチテキスト エディターでレンダリングするために使用している XSLT マクロ コードです。
<xsl:variable name="items" select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2 ]/* [@isDoc and string(umbracoNaviHide) != '1']"/>
<div > Sub Node </div>
<xsl:if test="count($items) > 0">
<xsl:for-each select="$items">
<xsl:if test="string-length($items/profileType) > 0">
<div> In If of Sub Node</div>
<xsl:variable name="Chkitems" select="umbraco.library:
Split($items/profileType,',')" />
<xsl:value-of select="$Chkitems"/>
<xsl:for-each select="$Chkitems//value">
<xsl:value-of select="current()"/>
</xsl:for-each>
</xsl:attribute>
</xsl:if>
</xsl:for-each>
</xsl:if>
リッチテキスト エディターで上記のマクロ レンダリングをプレビューできます。しかし、サイトでレンダリングしている間は、「サブノード」しか表示されません。または内部divの値ではありません。
ヘッダー「sectionHeading」の値を取得できますが、「sectionBody」を表示できません