Solved

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

Posted on 2011-02-15
8
1,050 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

740 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