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

Thread: XML for menu not applying attribute on selected category

  1. #1
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default XML for menu not applying attribute on selected category

    Hello all,

    I have gone through the forum and cant seem to find a solution for this problem. I am switched my side menu to use rev.categories.xml.config.
    but the following code will not work to apply the attribute. I am using v9.3.1.0,

    <a href="{aspdnsf:EntityLink(EntityID, SEName, 'Category', 0)}">
    <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>

    Any one know what I am missing? this is out of the box code, but something must be wrong.
    Last edited by virtualtap; 05-23-2013 at 04:00 PM.
    MSX

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    If you remove the xsl:test lines, does the code work?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  3. #3
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    Yes the code does work without the test.
    MSX

  4. #4
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Does it work individually with teach test condition (get ride of the OR and try one at a time).
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  5. #5
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    If I remove the test then all list items will receive the attribute. Even if I remove the OR it still does not work.
    Last edited by virtualtap; 05-28-2013 at 12:15 PM.
    MSX

  6. #6
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    I think perhaps I was misunderstood. Please tell me, do either of these lines work properly?

    Code:
    <xsl:if test="EntityID = $CategoryID">
    Code:
    <xsl:if test="descendant::Entity/EntityID = $CategoryID">
    In place of:

    Code:
    <xsl:if test="EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID">
    If so, then there is a problem with the or conjunction. If one of the two test conditions don't work as expected, then we'll have to fix that first.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  7. #7
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    Yes, neither of those work.
    MSX

  8. #8
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Have you checked the output value of the variables your testing by either using debug mode or by using a bunch of <xsl:value-of select=""/> statements?

    Are you getting any errors in the ASPDNSF event log?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM