2017-04-26 11 views
0

xslt 메가 메뉴 코드의 하단에 div를 추가하여 '모두보기'버튼/클릭 유도 문안의 하이퍼 링크를 표시하려고하지만 아무 것도 표시 할 수 없습니다.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

난 그냥 '보기'페이지로 내 메가 메뉴의 마지막 리튬을 가진 끝내었고, 적절하게 CSS 스타일을 사용합니다.