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

Thread: Expand a predeterimed Category

  1. #1
    Emissary is offline Member
    Join Date
    Sep 2008
    Location
    Florida
    Posts
    60

    Default Expand a predeterimed Category

    Can someone help me understand how I can set a specific Category to expand and show its subcategories by default as soon as someone visits the site. The category should also be able to collapse once another category has been selected. the idea is for this most used category to be expanded by default.

    I have seen other posts in the forum similar, but they only show how to expand all categories. That is not what we are needing to accomplish here.

    THANKS!

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

    Default

    Comment out the highlighted part of the sections below:
    Directory: {root}/skins/Skin_#/XmlPackages
    XMLPackage: rev.categories.xml.config

    Code:
                        <xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
                            <ul class="tame">
                                <xsl:apply-templates select="Entity">
                                    <xsl:with-param name="prefix" select="concat($prefix, '&#160;&#0160;')"/>
                                </xsl:apply-templates>
                            </ul>
                        </xsl:if>
    and that's it...

  3. #3
    Emissary is offline Member
    Join Date
    Sep 2008
    Location
    Florida
    Posts
    60

    Default

    Thanks Jao, but when you read my post - we are looking for how to expand only 1 specific category while not expanding the other categories. Like:

    Category1
    Category2
    SubCategoryA
    SubCategoryB
    SubCategoryC
    Category3
    Category4

    So when the user first comes to the site, they will see something like this example. We dont want to expand all categories, and right now nothing expands until you click on a particular category.

    I hope you understand what I am asking. As I said in my first post, others have asked about this same thing, but it seems that their post were forgotten and not answered.

    Thanks

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

    Default

    For instance the ID of Category2 is 2, you could replace that section with this one:

    Code:
                        
    <xsl:if test ="EntityID = 2 and count(child::Entity)&gt;0">
    <ul class="tame">
    <xsl:apply-templates select="Entity">
    <xsl:with-param name="prefix" select="concat($prefix, '&#160;&#0160;')"/>
    </xsl:apply-templates>
    </ul>
    </xsl:if>
    and that's it...

  5. #5
    Emissary is offline Member
    Join Date
    Sep 2008
    Location
    Florida
    Posts
    60

    Default

    Almost there - but not quite the desired effect.
    With your modifications the specified category id is ALWAYS expanded. What we want is to only force that category to be expanded only when someone comes into the website's main page. Then if the user clicks on another category, the usual effect of the clicked category expanding and all others collapsing should take place. All we really want is to force 1 particular category to be expanded when the user first comes into the site (when they hit the home page).
    Thanks