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 12 of 12

Thread: 'Create' vert menu only displaying subcats

  1. #1
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default 'Create' vert menu only displaying subcats

    Greetings,

    I am building a clothing store for a client...we have multiple categories all with subcategories. I am using a hometemplate.ascx that contains the main home page with the categories horizontal menu displayed (altered menudata.xml as "Categories0". I'd like to prevent the fly-outs from occurring but I'd also like to have the navigation work where, when a category is clicked on from the hometemplate.ascx page, I'd like to have a vert. menu on the left hand side that ONLY displays the subcategories tied to the selected parent category.

    HomeTemplate.ascx
    Brands | Girls | Boys | etc...
    I want to prevent flyouts
    'Boys' category is clicked ...

    template.ascx
    Horizontal of parent categories remain

    Vert Menu:
    Boys:
    -- Infants
    -- Preemie
    -- Toddler

    Is this easy to do...and, do I need to do a crash course in XMLPackage development to do this?
    TIA
    -Rich
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  2. #2
    akrogers is offline Junior Member
    Join Date
    Nov 2006
    Posts
    1

    Default

    If you find the answer to this, I'd like to know as well. I tried using:
    (!CATEGORY_BROWSE_BOX!)
    but it put a red arrow image beside them and I couldn't find where to change that. I'd also like to have the subcategories listed under the categories when clicked. I've seen several posts about how to configure that left menu, but not many suggestions. This seems like something most people would need to configure and should be a little more intuitive. Hopefully someone will point us in the right direction.
    --Angela

  3. #3
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default

    I don't have a problem with that so much, I just need to make sure that not ALL categories are in the vert menu, only the ones that are tied to the category in focus on the page. Hopefully that makes more sense.
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  4. #4
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default

    Little help?
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  5. #5
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default

    Not to be a pain, but I've paid for the product....where's the support? I can't imagine my request is impossible.
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  6. #6
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Should be rather simple...here's the code for a modified rev.categories.xml.config file that I called template.subcategories.xml.config, and I called it from the template using
    Code:
    (!XmlPackage Name="template.subcategories.xml.config!)
    Code:
    <?xml version="1.0" standalone="yes" ?>
    <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="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:param name="CategoryID">
                    <xsl:choose>
                        <xsl:when test="/root/QueryString/categoryid">
                            <xsl:value-of select="/root/QueryString/categoryid"/>
                        </xsl:when>
                        <xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:param>
    
                <xsl:template match="/">
                    <xsl:element name="ul">
                        <xsl:attribute name="class">
                            <![CDATA[tame]]>
                        </xsl:attribute>
    
                        <xsl:for-each select="/root/EntityHelpers/Category/Entity">
                            <xsl:sort select="DisplayOrder"/>
                            <xsl:sort select="Name"/>
                            <xsl:sort select="EntityID"/>
    
                            <xsl:if test="(EntityID = $CategoryID) or (EntityID = $AncestorID)">
    
                                <xsl:for-each select="descendant::Entity[(descendant::ParentEntityID = $CategoryID) or (descendant::EntityID = $CategoryID)]">
                                    <xsl:sort select="DisplayOrder"/>
                                    <xsl:sort select="Name"/>
                                    <xsl:sort select="EntityID"/>
                                    <xsl:variable name="EntityID" select="EntityID"/>
    
                                    <xsl:element name="li">
                                        <xsl:call-template name="Space">
                                            <xsl:with-param name="count" select="count(ancestor::*/Entity[(descendant::EntityID = $EntityID)]) - 1"/>
                                        </xsl:call-template>
                                        <xsl:element name="a">
                                            <xsl:attribute name="href">
                                                <xsl:value-of select="concat('c-',EntityID,'-',SEName,'.aspx')"/>
                                            </xsl:attribute>
                                            <xsl:value-of select="Name"/>
                                        </xsl:element>
                                    </xsl:element>
    
                                </xsl:for-each>
    
                            </xsl:if>
                        </xsl:for-each>
    
                    </xsl:element>
                </xsl:template>
    
                <xsl:template name="Space">
                    <xsl:param name="count" select="1"/>
                    <xsl:if test="$count > 0">
                        <xsl:text>*</xsl:text>
                        <xsl:call-template name="Space">
                            <xsl:with-param name="count" select="$count - 1"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:template>
    
            </xsl:stylesheet>
        </PackageTransform>
    </package>

  7. #7
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default

    Thanks for the reply, sir. So this does indeed require an XMLPackage mod, that's what I was afraid of, but thank you so much for the pseudo, very much appreciated!

    Edit: Worked perfectly, thanks again!
    Last edited by RichWallace; 08-09-2007 at 05:34 PM.
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  8. #8
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default

    Well, I thought I was right there....

    When a visitor clicks on a category from the menu, now, only that selected category displays rather than all categories under the main parent...my fault for not clarifying. Soooo....what I guess I need is something like this: click here... where, when a physical child category is selected, all the remain categories still remain visible.

    Thanks and again, I apologize for not clarifying.

    -Rich
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  9. #9
    harry11 is offline Junior Member
    Join Date
    Sep 2007
    Posts
    2

    Default keeping sub categories visible

    I need the same thing... to keep the subcategories visible after you click on another subcategory.

    Have you discovered how to do this???

    Thanks,
    Harry

  10. #10
    RichWallace is offline Junior Member
    Join Date
    Aug 2007
    Location
    Phoenix, AZ
    Posts
    9

    Default

    Hey Harry,

    I haven't, seems that the menu component isn't covered much here since it's sourced from the vendor, unless you have the full source...which I do not have. My client ended up scrapping it since I just couldn't get any ideas on it.

    -Rich
    "History will be kind to me as I intend to write it."

    http://richwallace.net

  11. #11
    Univest is offline Member
    Join Date
    Feb 2010
    Posts
    30

    Thumbs up ancestor problem

    Thanks George for a excellent package. Only problem is that
    when you drill down the categories the parent one shows also and
    and when you have deep subcategories it cant drill down to the categories deeper down.

    are you able to modify it so it acts exactly like the categories shown inside the grid please. it drills down nicely to any subcat u want and the rest dissapears without any parents shown.

    thank you again

  12. #12
    osdude is offline Senior Member
    Join Date
    Nov 2007
    Location
    earth
    Posts
    202

    Default

    I know you guys aren't going to like this, but I needed the same thing and ended up making my own menus and calling those in a template for that category. That way, regardless of the subcat you're in, all the siblings still show. It's not an easy solution, but it allows you to make it look exactly how you want it to look and it isn't as hard as it seems. You only need one cat_template per cat and it works for all the sibling cats too. Hope that helps a little.