Solved

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

Posted on 2011-02-15
8
1,047 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 60

Expert Comment

by:Geert Bormans
Comment Utility
can you also post the source XML?
0
 

Author Comment

by:jeremyll
Comment Utility
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
Comment Utility
Problem got too complicated to explain
0
 
LVL 60

Expert Comment

by:Geert Bormans
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

744 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

11 Experts available now in Live!

Get 1:1 Help Now