2017-04-26 3 views
0

xsltメガメニューコードの下部にdivを追加して、[View All]ボタン/アクションを呼び出すハイパーリンクを表示しようとしていますが、何も表示できません。XSLTメガメニューのリンクを表示する

 <?xml version="1.0" encoding="UTF-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
     <xsl:output method="html"/> 
     <xsl:param name="ControlID" /> 
     <xsl:param name="Options" /> 

    <xsl:param name="subMenuColumns">1</xsl:param> 
    <xsl:param name="subpointer"><![CDATA[]]></xsl:param> 
    <xsl:param name="pointer"><![CDATA[]]></xsl:param> 
    <xsl:param name="startUl"><![CDATA[<ul>]]></xsl:param> 
    <xsl:param name="endUl"><![CDATA[</ul>]]></xsl:param> 
    <xsl:template match="/*"> 
    <xsl:apply-templates select="root" /> 
    </xsl:template> 
    <xsl:template match="root"> 
    <script type="text/javascript"> 
     function splitSubMenu(columns) { 
     jQuery("div.sub").each(function (i) { 
     if (i==1) { 
     columns=4; 
     } else { 
     columns=4; 
     } 
     var items = jQuery(this).find('ul'); 
     var blockCount = columns; 
    </script> 
    <ul class="megamenu" id="megamenu"> 
     <xsl:apply-templates select="node"> 
     <xsl:with-param name="level" select="0"/> 
     </xsl:apply-templates> 
    </ul> 
    </xsl:template> 
    <xsl:template match="node"> 
    <xsl:param name="level" /> 
    <xsl:choose> 
     <xsl:when test="$level=0"> 
     <li> 
      <xsl:attribute name="class"> 
      level0 <xsl:if test="@breadcrumb = 1">current</xsl:if> 
      </xsl:attribute> 
      <a> 
      <xsl:attribute name="class"> 
       level0 <xsl:if test="@breadcrumb = 1">current</xsl:if> 
      </xsl:attribute> 
      <xsl:choose> 
       <xsl:when test="@enabled = 1"> 
       <xsl:attribute name="href"> 
        <xsl:value-of select="@url"/> 
       </xsl:attribute> 
       </xsl:when> 
       <xsl:otherwise> 
       <xsl:attribute name="href">#</xsl:attribute> 
       <xsl:attribute name="onclick">return false</xsl:attribute> 
       </xsl:otherwise> 
      </xsl:choose> 
      <xsl:value-of select="@text" /> 
      <xsl:if test="node"> 
       <xsl:value-of select="$pointer" disable-output-escaping="yes"/> 
      </xsl:if> 
      </a> 
      <xsl:if test="node"> 
      <div class="sub"> 
       <xsl:apply-templates select="node"> 
       <xsl:with-param name="level" select="$level + 1" /> 
       </xsl:apply-templates> 

      </div> 

      </xsl:if> 
     </li> 
     </xsl:when> 
     <xsl:when test="$level=1"> 
     <ul class="megamenusubcontent"> 
      <li class="subheader"> 
      <h2> 
       <a> 
       <xsl:choose> 
        <xsl:when test="@enabled = 1"> 
        <xsl:attribute name="href"> 
         <xsl:value-of select="@url"/> 
        </xsl:attribute> 
        </xsl:when> 
        <xsl:otherwise> 
        <xsl:attribute name="href">#</xsl:attribute> 
        <xsl:attribute name="onclick">return false</xsl:attribute> 
        </xsl:otherwise> 
       </xsl:choose> 
       <xsl:value-of select="@text" /> 
       </a> 
      </h2> 
      </li> 

      <xsl:if test="node"> 
      <xsl:apply-templates select="node"> 
       <xsl:with-param name="level" select="$level + 1" /> 
      </xsl:apply-templates> 
      </xsl:if> 

     </ul> 

     </xsl:when> 

     <xsl:otherwise> 
     <li class="sublink"> 
      <a> 
      <xsl:choose> 
       <xsl:when test="@enabled = 1"> 
       <xsl:attribute name="href"> 
        <xsl:value-of select="@url"/> 
       </xsl:attribute> 
       </xsl:when> 
       <xsl:otherwise> 
       <xsl:attribute name="href">#</xsl:attribute> 
       <xsl:attribute name="onclick">return false</xsl:attribute> 
       </xsl:otherwise> 
      </xsl:choose> 
      <xsl:value-of select="@text" /> 
      </a> 
     </li> 
     <xsl:if test="node"> 
      <xsl:apply-templates select="node"> 
      <xsl:with-param name="level" select="$level + 1" /> 
      </xsl:apply-templates> 
     </xsl:if> 
     </xsl:otherwise> 
    </xsl:choose> 
    </xsl:template> 
</xsl:stylesheet> 

二つの質問は本当に、1)私は、次のように私のメガメニューの一番下にある「すべて表示」リンクアクションへの呼び出しを表示するために使用されますどのようなXSL翻訳:

次のように私のXSLTコードがあります

enter image description here

2)ここで、XSLTテンプレートに私はそれがメガメニュードロップダウンにすべてのメニューリストの一番下に表示されるようにするには挿入するのですか?

私は次のバリエーションを試してみましたが、まだ何も画面に表示されなかっ:

<xsl:template match="url"> 
    <a href="{.}"> 
     <xsl:value-of select="../view-all"/> 
    </a> 
    </xsl:template> 

乾杯

答えて

0

私はちょうど「全てを見る」のページとしての私のメガメニューの最後のLiを持つことになったとそれに応じてCSSスタイルを使用します。

関連する問題