Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 9 of 9

Thread: Left nav - accordian menu - need some help almost got it!

  1. #1
    justinlseitz is offline Junior Member
    Join Date
    Aug 2008
    Posts
    8

    Default Left nav - accordian menu - need some help almost got it!

    I have been working on getting the left nav to have the accordian menu effect. I have almost got it figured out but i cannot get the subcategories to accept the new tame class created. Below is my html code of what the site looks like.

    HTML CODE:
    __________________________________________________ _____________

    <div class="leftNav" id="categories">
    <ul class="tame">
    <li class="tame"><a href="c-3-door-guards.aspx">Door Guards</a></li>
    <li class="tame"><a href="c-25-safety-barriers.aspx">Safety Barriers</a></li>
    <li class="tame"><a href="c-13-guard-rails.aspx" style="font-weight:bold">Guard Rails</a>

    <ul class="tameTWO">
    <li class="tame">**<a href="c-23-guard-rails.aspx">Guard Rails</a></li>
    <li class="tame">**<a href="c-30-removable-guard-rail-and-gates.aspx">Removable Guard Rail and Gates</a></li>
    <li class="tame">**<a href="c-16-mounting-post-44-double-rail.aspx">Mounting Post 44" (Double Rail)</a></li>
    <li class="tame">**<a href="c-15-mounting-post-18-single-rail.aspx">Mounting Post 18" (Single Rail)</a></li>
    <li class="tame">**<a href="c-14-guard-rail-accessories.aspx">Guard Rail Accessories</a></li>
    </ul>
    </li>

    __________________________________________________ _____________

    Notice that the sub categories still read from the original tame class and not the tameTWO class.

    Here is the XML code that i have for the site.

    XML CODE
    __________________________________________________ _____________
    <xsl:template match="Entity">
    <xsl:param name="prefix"></xsl:param>
    <xsl:param name="eName" select="aspdnsf:GetMLValue(Name)" />

    <li class="tame">
    <xsl:value-of select="$prefix" />
    <xsl:if test="number(ParentEntityID) != 0">
    </xsl:if>

    <a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
    <xsl:if test="EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID">
    <xsl:attribute name="style">font-weight:bold</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="$eName"/>
    </a>
    <xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
    <ul class="tameTWO">
    <xsl:apply-templates select="Entity">
    <xsl:with-param name="prefix" select="concat($prefix, '**')"/>
    </xsl:apply-templates>
    </ul>
    </xsl:if>
    </li>
    </xsl:template>
    __________________________________________________ ______________

    For some reason i cannot get the XML to reference the other tame so the leftNav looks correct. Is there any help out there?

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Inside this section <xsl:template match="/"> look for this line:
    Code:
    <xsl:with-param name="prefix" select="''"/>
    add this:
    Code:
    <xsl:with-param name="classToUse" select="'tame'"/>
    just below it: . Then add the following line:
    Code:
    <xsl: param name="classToUse"></xsl: param>
    on the <xsl:template match="Entity"> section, just below: <xsl: param name="eName" select="aspdnsf:GetMLValue(Name)" />. Change the following:
    Code:
    <li class="tame">
    to
    Code:
    <li class="{$classToUse}">
    and so with this line:
    Code:
    <ul class="tame">
    to
    Code:
    <ul class="tamesub">
    (tamesub was used for clarity) and within this section, add this line:
    Code:
    <xsl:with-param name="classToUse" select="'tametwo'"/>
    at the top of <xsl:with-param name="prefix" select="concat($prefix, '**')"/>
    Last edited by Jao; 03-09-2009 at 01:13 AM.

  3. #3
    dragon is offline Member
    Join Date
    Feb 2009
    Posts
    66

    Default

    I have put the code in as you have listed. I'm getting this error:

    Exception=Error in XmlPackage(.Load), Package=[rev.categories], Msg=[Exception=Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 48, position 12.
    ]

    Line 48 is <xsl: param name="classToUse"></xsl: param>


    My code looks like this:

    #########################################
    <package version="2.1" displayname="Categories" debug="false" includeentityhelper="true">
    <PackageTransform>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
    <xslutput method="html" omit-xml-declaration="yes"/>

    <xslaram name="CategoryID">
    <xsl:choose>
    <xsl:when test="/root/System/PageName = 'showmanufacturer.aspx' or /root/System/PageName = 'showsection.aspx' or /root/System/PageName = 'showdistributor.aspx' or /root/System/PageName = 'showvector.aspx' or /root/System/PageName = 'showgenre.aspx'">0</xsl:when>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)">
    <xsl:value-of select="/root/QueryString/categoryid"/>
    </xsl:when>
    <xsl:when test="(/root/System/PageName = 'showcategory.aspx' or /root/System/PageName = 'showproduct.aspx') and boolean(/root/Cookies/LastViewedEntityInstanceID) and /root/Cookies/LastViewedEntityName = 'Category'">
    <xsl:value-of select="/root/Cookies/LastViewedEntityInstanceID"/>
    </xsl:when>
    <xsltherwise>0</xsltherwise>
    </xsl:choose>
    </xslaram>

    <xslaram name="AncestorID">
    <xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
    <xsl:value-of select="ancestor::*/EntityID"/>
    </xsl:for-each>
    </xslaram>

    <xslaram name="ParentID">
    <xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
    <xsl:value-of select="parent::*/EntityID"/>
    </xsl:for-each>
    </xslaram>


    <xsl:template match="/">
    <xsl:element name="ul">
    <xsl:attribute name="class">
    <![CDATA[tame]]>
    </xsl:attribute>

    <xsl:apply-templates select="/root/EntityHelpers/Category/Entity">
    <xsl:with-param name="prefix" select="''"/>
    <xsl:with-param name="classToUse" select="'tame'"/>
    <xsl: param name="classToUse"></xsl: param>
    </xsl:apply-templates>

    </xsl:element>
    </xsl:template>

    <xsl:template match="Entity">
    <xslaram name="prefix"></xslaram>
    <xslaram name="eName" select="aspdnsf:GetMLValue(Name)" />


    <li class="{$classToUse}">
    <xsl:value-of select="$prefix" />
    <xsl:if test="number(ParentEntityID) != 0">
    <span class="catMark">*</span>&#160;
    </xsl:if>
    <a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
    <xsl:if test="EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID">
    <xsl:attribute name="style">font-weight:bold</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="$eName"/>
    </a>


    <xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
    <ul class="tamesub">
    <xsl:with-param name="classToUse" select="'tametwo'"/>
    <xsl:apply-templates select="Entity">
    <xsl:with-param name="prefix" select="concat($prefix, '&#160;&#0160;')"/>
    </xsl:apply-templates>
    </ul>
    </xsl:if>
    </li>
    </xsl:template>

    </xsl:stylesheet>
    </PackageTransform>
    </package>

  4. #4
    MelanieA is offline Junior Member
    Join Date
    Sep 2008
    Posts
    313

    Default Try this one..

    Just copy paste this on your rev.categories.xml.config file

    Code:
    <package version="2.1" displayname="Categories" debug="false" includeentityhelper="true">
        <PackageTransform>
            <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
                <xsl:output method="html" omit-xml-declaration="yes"/>
    
                <xsl:param name="CategoryID">
                    <xsl:choose>
                        <xsl:when test="/root/System/PageName = 'showmanufacturer.aspx' or /root/System/PageName = 'showsection.aspx' or /root/System/PageName = 'showdistributor.aspx' or /root/System/PageName = 'showvector.aspx' or /root/System/PageName = 'showgenre.aspx'">0</xsl:when>
                        <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)">
                            <xsl:value-of select="/root/QueryString/categoryid"/>
                        </xsl:when>
                        <xsl:when test="(/root/System/PageName = 'showcategory.aspx' or /root/System/PageName = 'showproduct.aspx') and boolean(/root/Cookies/lastviewedentityinstanceid) and /root/Cookies/lastviewedentityname = 'Category'">
                            <xsl:value-of select="/root/Cookies/lastviewedentityinstanceid"/>
                        </xsl:when>
                        <xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:param>
    
                <xsl:param name="AncestorID">
                    <xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
                        <xsl:value-of select="ancestor::*/EntityID"/>
                    </xsl:for-each>
                </xsl:param>
    
                <xsl:param name="ParentID">
                    <xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
                        <xsl:value-of select="parent::*/EntityID"/>
                    </xsl:for-each>
                </xsl:param>
    
    
                <xsl:template match="/">
                    <xsl:element name="ul">
                        <xsl:attribute name="class">
                            <![CDATA[tame]]>
                        </xsl:attribute>
    
                        <xsl:apply-templates select="/root/EntityHelpers/Category/Entity">
                          <xsl:with-param name="prefix" select="''"/>
                          <xsl:with-param name="classToUse" select="'tame'"/>
                        </xsl:apply-templates>
    
                    </xsl:element>
                </xsl:template>
    
    			<xsl:template match="Entity">
            <xsl:param name="classToUse"></xsl:param>
            <xsl:param name="prefix"></xsl:param>
                    <xsl:param name="eName" select="aspdnsf:GetMLValue(Name)" />
    
    
            <li class="{$classToUse}">
              <xsl:value-of select="$prefix" />
                        <xsl:if test="number(ParentEntityID) != 0">
                            <span class="catMark">&gt;&gt;</span>&#160;
                        </xsl:if>
                        <a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
                            <xsl:if test="EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID">
                                <xsl:attribute name="style">font-weight:bold</xsl:attribute>
                            </xsl:if>
                            <xsl:value-of select="$eName"/>
                        </a>
    
    
                        <xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
                          <ul class="tamesub">                            <xsl:apply-templates select="Entity">
                                  <xsl:with-param name="classToUse" select="'tametwo'"/>
                                    <xsl:with-param name="prefix" select="concat($prefix, '&#160;&#0160;')"/>
                                </xsl:apply-templates>
                            </ul>
                        </xsl:if>
                    </li>
                </xsl:template>
    
            </xsl:stylesheet>
        </PackageTransform>
    </package>
    Then check if this works for you...

  5. #5
    dragon is offline Member
    Join Date
    Feb 2009
    Posts
    66

    Default

    Melanie that solution fixed the error. The left nav ends up the same as it was before I stared. Alfred I also tried you change and the error still shows. Maybe this code is not what I'm looking for. Do I need to use the first code that justinlseitz along with this to make it work? If so where do I put this code? This is a copy of the code that he submitted:
    XML CODE
    __________________________________________________ _____________
    <xsl:template match="Entity">
    <xslaram name="prefix"></xslaram>
    <xslaram name="eName" select="aspdnsf:GetMLValue(Name)" />

    <li class="tame">
    <xsl:value-of select="$prefix" />
    <xsl:if test="number(ParentEntityID) != 0">
    </xsl:if>

    <a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
    <xsl:if test="EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID">
    <xsl:attribute name="style">font-weight:bold</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="$eName"/>
    </a>
    <xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
    <ul class="tameTWO">
    <xsl:apply-templates select="Entity">
    <xsl:with-param name="prefix" select="concat($prefix, '**')"/>
    </xsl:apply-templates>
    </ul>
    </xsl:if>
    </li>
    </xsl:template>



    I'm trying to make the left nav able to something like you see in skin 5. I like the Browse By section. I like the little plus symbol that allows the customer to be able to click the plus symbol and the child categories show up with out them actually having to go to the parent page first and then they are able to see the child categories.

    I would ideally like it to be a dynamic menu. Basically what I'm looking to do it take the navigation from a click-reload-expand type navigation to a dynamic fly out list or an Accordion menu. If I was to put in my own dynamic menu what is the query that pulls the categories, and a for each statement that build the list.

    By the way I would like to thank all of you for all of your help. I have just purchased this cart. I'm so glad that I switched. It is wonderful and this forum is hands down the best I have been on.

  6. #6
    dragon is offline Member
    Join Date
    Feb 2009
    Posts
    66

    Default

    I have found a code that I would like to use for dynamic menu on the side. I have loaded the CSS into the css file. I have also loaded all of the other elements needed to run the the menu. I'm getting tripped up at where to put the the rest of the code. I would like for the shopping to continue make up the menus. I don't want to have to keep building the menus every time I change something. It is called

    <div class="arrowlistmenu">

    How do I call it into place. I'm thinking that it need to go into the rev.categories.xml file but I have no idea how to pull it in to make it work.

  7. #7
    gmaniac is offline Member
    Join Date
    Jul 2010
    Location
    Missouri
    Posts
    59

    Default

    Dragon did you ever find the answer to your question. I am currently working on this same thing I am getting an error in line 37 position 12. I believe it is the same problem that you were running into though.

  8. #8
    gmaniac is offline Member
    Join Date
    Jul 2010
    Location
    Missouri
    Posts
    59

    Default Simple Solution

    I was able to call the tameSub in the xsl file here is my code:
    Code:
    <xsl:template match="/">
                    <xsl:element name="ul">
                        <xsl:attribute name="class">
                            <![CDATA[tameSub]]>
                        </xsl:attribute>
    
                        <xsl:apply-templates select="/root/EntityHelpers/Manufacturer/Entity">
                            <xsl:with-param name="prefix" select="''"/>
    						<xsl:with-param name="classToUse" select="'tameSub'"/>
                        </xsl:apply-templates>
    
                    </xsl:element>
                </xsl:template>
    
    			<xsl:template match="Entity">
                    <xsl:param name="prefix"></xsl:param>
                    <xsl:param name="classToUse"></xsl:param>
    				<xsl:param name="eName" select="aspdnsf:GetMLValue(Name)" />
    
    
                    <li class="tame">
                        <xsl:value-of select="$prefix" />
                        <xsl:if test="number(ParentEntityID) != 0">
                            <span class="catMark">&gt;&gt;</span>*
                        </xsl:if>
                        <a href="{concat('m-',EntityID,'-',SEName,'.aspx')}">
                            <xsl:if test="EntityID = $ManufacturerID or descendant::Entity/EntityID = $ManufacturerID">
                                <xsl:attribute name="style">font-weight:bold</xsl:attribute>
                            </xsl:if>
                            <xsl:value-of select="$eName"/>
                        </a>
    
    
                        <xsl:if test="count(child::Entity)&gt;0 and (EntityID = $ManufacturerID or descendant::Entity/EntityID = $ManufacturerID)">
                            <ul class="tamesub">
                                <xsl:apply-templates select="Entity">
                                    <xsl:with-param name="classToUse" select="tameSub"/>
                                <xsl:with-param name="prefix" select="concat($prefix, '**')"/>
    								</xsl:apply-templates>
                            </ul>
                        </xsl:if>
                    </li>
                </xsl:template>
    BUT there is a simpler way to make an accordion laftNav I show you how in this post http://forums.aspdotnetstorefront.co...ad.php?t=23503 Good luck with your programming

  9. #9
    ashish.patel is offline Junior Member
    Join Date
    Jan 2011
    Posts
    22

    Default

    You might be interested to take a look at this: Left Menu Accordion using jQuery in AspDotNetStoreFront
    It’s very easy to implement. Hope this helps.

    http://www.ashishblog.com/blog/left-...netstorefront/