Solved

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

Posted on 2011-02-15
8
1,048 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
 

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

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.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

930 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now