Solved

XSL: side tree navigation (IF child node is open THEN make its parent node RED font)

Posted on 2011-02-15
8
1,049 Views
Last Modified: 2012-08-13
I'm making changes to the LHS navigation to this site: http://www.thelearningfederation.edu.au/for_jurisdictions/collaborative_networks/collaborative_networks.html

Believe I need to add this extra code somewhere between lines 388-399 of the untitled.xsl file attached.

 
<li>
              <xsl:choose>
               <!-- <xsl:when test="position() = 1"></xsl:when>-->
               <!-- IF child node is open THEN make its parent node BOLD -->
                <xsl:when test="@id = $assetID">
                  <a href="{$TopLinkURL}" class="{$selected}"><b><xsl:value-of select="@title" /></b></a>
                </xsl:when>
                <xsl:otherwise>
                  <a href="{$TopLinkURL}" class="{$selected}"><xsl:value-of select="@title" /></a>
                </xsl:otherwise>
              </xsl:choose>

Open in new window


 untitled.xsl
0
Comment
Question by:jeremyll
  • 4
  • 4
8 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34904111
seems like all you need to do is replace this (line 394)
                  <a href="{$TopLinkURL}" class="{$selected}"><b><xsl:value-of select="@title" /></b></a>
into this
                  <a href="{$TopLinkURL}" class="{$selected}"><span style="color:red;"><xsl:value-of select="@title" /></span></a>

you might also need to change the CSS a little to make sure that the blue color of the link does not take precedence

and if you still need it bold, leave the <b> tags intact and wrap the <span> around it (or inside it)

I hope this is waht you need, and if it is not, explain in detail what you need because your question is VERY unclear
0
 

Author Comment

by:jeremyll
ID: 34912947
Thanks Gertone, that's not exactly what I'm after.

I need all the navigation items to be BOLD/RED when child node is open THEN make ITS parent node BOLD/RED. So when navigation tree is opened at three levels deep, there should be 3 navigation items bold/red. If it's four levels deep, then 4 items bold/red, etc.

I hope this explains my question better.
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 34913720
well, no it does not and yes it does a little.

I now understand what you are after (that was absolutely not clear from the first question)

but now it still is a puzzle how you know that a child node is open?

I took the naieve approach thinking that the functionality you needed was explained in the comment from the original code,
as you are trying to change an existing code-base
... so it is not.

I need to know
- how the original code behaves (the one you posted)
- how the source XML looks like
- how we know what "open" means in terms of parameter values, element or attribute values
- how much of the code you sent is original and what you have changed so far

I can't reconstruct what you have with the information you have given sofar
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:jeremyll
ID: 34915374
The image is an example of how I would like the navigation styling to behave.

In the example image the parent node of 'design and development overview' (3rd level) is 'Guide to learning object development' (2nd level) which is the child node of 'Resource process development' (1st level.

hope this is clearer.

The only code I've changed so far is those line 388-299 in the code embeded in the first post.

 example
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34965670
can you also post the source XML?
0
 

Author Comment

by:jeremyll
ID: 34966219
I'm new to xml/xsl. And not exactly sure what you mean by the XML. Is this the XML output that is produced by the xs parsed?

I have a good feeling which file you want, but the file is 7MB
0
 

Author Closing Comment

by:jeremyll
ID: 35013919
Problem got too complicated to explain
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 35014827
I think it got indeed.
You can still zip the file (yes, I likely need the 7MB file, but you could strip it down to essentials)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question