Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Menu Styling with the Accordian TemplateMenu Styling with the Accordian Template
Previous
 
Next
New Post
6/23/2012 12:44 PM
 

I am using the accordian menu as a left hand navigation menu where I have 3 levels so it looks like this;
Root Menu
Menu
Submenu

So my root menu appears across the top of my page and is constant. My left hand accordian menu appears on each page and shows all the Menu level items as headings with a list of Submenu items when you click on each Menu level item - the accordian effect.

I am using the pre-built template and have managed to style is just about the way I want except for 2 problems.
1. The accordian menu has an option to Style the active Menu heading ".toolsaccordion h3.current" but not the Submenu (which is really the active page) I have tried ".toolsaccordian .current", ".toolsaccordian .active" and none of them work.

2. I would really like to put an image to the far right of the Menu heading (down arrow) so when you click on the accordian Menu heading and it expands, it then changes to an up arrow.

Thanks.

 
New Post
6/23/2012 1:18 PM
 

Ok so I figured out the image for up and down. I am completly stumped how to set the style for the currently selected Submenu link

I have been reading the documentataion and I am sure I need to implement the @selected or @breadcrumb somewhere. Here is the XSLT code

<?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="CSSClass" />
  <xsl:template match="/*">
    <xsl:apply-templates select="root" />
  </xsl:template>
  <xsl:template match="root">
  <script type="text/javascript">
      jQuery(function($) {
        var options = { initialIndex: -1 };
        $.extend(options, { <xsl:apply-templates select="node" mode="breadcrumb" /> }, <xsl:value-of select="$Options" />);
      $("#<xsl:value-of select="$ControlID" />").tabs(".toolsaccordion div.pane", options);
   });
  </script>
  <div id="{$ControlID}" class="toolsaccordion">
   <xsl:apply-templates select="node" />
  </div>
 </xsl:template>
  <xsl:template match="node" mode="breadcrumb">
    <xsl:if test="@breadcrumb = 1">initialIndex: <xsl:value-of select="position() - 1" /></xsl:if>
  </xsl:template>
 <xsl:template match="node">
  <h3>
   <a href="{@url}">
    <xsl:value-of select="@text" />
   </a>
  </h3>
  <div class="pane">
   <xsl:apply-templates select="node" mode="sub">
    <xsl:with-param name="level" select="0" />
   </xsl:apply-templates>
  </div>
 </xsl:template>
 <xsl:template match="node" mode="sub">
  <xsl:param name="level" />
  <xsl:choose>
   <xsl:when test="@enabled = 0">
    <div>
     <xsl:call-template name="indent">
      <xsl:with-param name="level" select="$level" />
     </xsl:call-template>
     <xsl:value-of select="@text" />
    </div>
   </xsl:when>
   <xsl:otherwise>
    <a style="display:block" href="{@url}">
     <xsl:call-template name="indent">
      <xsl:with-param name="level" select="$level" />
     </xsl:call-template>
     <xsl:value-of select="@text" />
    </a>
   </xsl:otherwise>
  </xsl:choose>
  <xsl:apply-templates select="node" mode="sub">
   <xsl:with-param name="level" select="$level + 1" />
  </xsl:apply-templates>
 </xsl:template>
 <xsl:template name="indent">
  <xsl:param name="level" />
  <xsl:if test="$level &gt; 0">
   &#160;&#160;<xsl:call-template name="indent">
    <xsl:with-param name="level" select="$level - 1" />
   </xsl:call-template>
  </xsl:if>
 </xsl:template>
</xsl:stylesheet>

 
New Post
6/25/2012 4:45 PM
 

For those interested;

<?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="CSSClass" />
  <xsl:template match="/*">
    <xsl:apply-templates select="root" />
  </xsl:template>
  <xsl:template match="root">
  <script type="text/javascript">
      jQuery(function($) {
        var options = { initialIndex: -1 };
        $.extend(options, { <xsl:apply-templates select="node" mode="breadcrumb" /> }, <xsl:value-of select="$Options" />);
      $("#<xsl:value-of select="$ControlID" />").tabs(".toolsaccordion div.pane", options);
   });
  </script>
  <div id="{$ControlID}" class="toolsaccordion">
   <xsl:apply-templates select="node" />
  </div>
 </xsl:template>
  <xsl:template match="node" mode="breadcrumb">
    <xsl:if test="@breadcrumb = 1">initialIndex: <xsl:value-of select="position() - 1" /></xsl:if>
  </xsl:template>
 <xsl:template match="node">
  <h3>
   <a href="{@url}">
    <xsl:value-of select="@text" />
   </a>
  </h3>
  <div class="pane">
   <xsl:apply-templates select="node" mode="sub">
    <xsl:with-param name="level" select="0" />
   </xsl:apply-templates>
  </div>
 </xsl:template>
 <xsl:template match="node" mode="sub">
  <xsl:param name="level" />
  <xsl:choose>
   <xsl:when test="@selected=1">
    <div class="toolsaccordianselected">
     <xsl:call-template name="indent">
      <xsl:with-param name="level" select="$level" />
     </xsl:call-template>
     <xsl:value-of select="@text" />
    </div>
   </xsl:when>
   <xsl:otherwise>
    <a style="display:block" href="{@url}">
     <xsl:call-template name="indent">
      <xsl:with-param name="level" select="$level" />
     </xsl:call-template>
     <xsl:value-of select="@text" />
    </a>
   </xsl:otherwise>
  </xsl:choose>
  <xsl:apply-templates select="node" mode="sub">
   <xsl:with-param name="level" select="$level + 1" />
  </xsl:apply-templates>
 </xsl:template>
 <xsl:template name="indent">
  <xsl:param name="level" />
  <xsl:if test="$level &gt; 0">
   &#160;&#160;<xsl:call-template name="indent">
    <xsl:with-param name="level" select="$level - 1" />
   </xsl:call-template>
  </xsl:if>
 </xsl:template>
 <xsl:template name="selected">
  <xsl:param name="level" />
  <xsl:if test="$level &gt; 0">
   &#160;&#160;<xsl:call-template name="indent">
    <xsl:with-param name="level" select="$level - 1" />
   </xsl:call-template>
  </xsl:if>
 </xsl:template>
</xsl:stylesheet>

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Menu Styling with the Accordian TemplateMenu Styling with the Accordian Template


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out