Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-02-15
8
Medium Priority
?
1,053 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 1500 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

670 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