我有一个网站,其中包含所附图片中的页面和子页面。
一些子页面属于第一个页面(关于患者直接),它们已设置“不显示在菜单中”。
好吧,我想做一个 xslt 文件,它会生成这样的 html 内容:
菜单项 1(包括主页 - About Patient Direct)
-子菜单第 1 页 1
菜单项 2(包括主页 - About Patient Direct)
-子菜单第 2 页 1
-子菜单页 2 2
我怎样才能做到这一点?
这是我到目前为止所拥有的
<?xml version="1.0" encoding="UTF-8"?>
]>
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<xsl:if test="$currentPage/@id = $currentPage/ancestor-or-self::* [@level=$level]/@id">
<div class="column">
<h1>
<a href="#">
Home Page - I don't know what to write here
</a>
</h1>
</div>
</xsl:if>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<div class="column">
<h1>
<xsl:choose>
<xsl:when test="name() = 'Link'">
<a href="{current()/linkUrl}" target="_blank">
<xsl:value-of select="@nodeName" />
</a>
</xsl:when>
<xsl:otherwise>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName" />
</a>
</xsl:otherwise>
</xsl:choose>
</h1>
</div>
</xsl:for-each>
</xsl:template>