Creating a two level list of nodes Options
Doogie Talons
Posted: Tuesday, April 22, 2008 1:33:46 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Hi I'm trying to create a two level list of nodes ala...

<ul>
<li>Option 1</li>
<li>Option 2</li>
<ul>
<li>Option 2/ Point 1</li>
<li>Option 2/ Point 2</li>
</ul>
<li>Option 3</li>
<li>Option 4</li>
<ul>
<li>Option 4 / Point 1</li>
<li>Option 4 / Point 2</li>
</ul>
<li>Option 5</li>
</ul>

Where it creates a little sub list should a set of children exist...

What I'm getting is where it is just repeating the set of children from the selected page.

<ul>
<li>Option 1</li>
<ul>
<li>Option 2/ Point 1</li>
<li>Option 2/ Point 2</li>
</ul>
<li>Option 2</li>
<ul>
<li>Option 2/ Point 1</li>
<li>Option 2/ Point 2</li>
</ul>
<li>Option 3</li>
<ul>
<li>Option 2/ Point 1</li>
<li>Option 2/ Point 2</li>
</ul>
<li>Option 4</li>
<ul>
<li>Option 2/ Point 1</li>
<li>Option 2/ Point 2</li>
</ul>
<li>Option 5</li>
<ul>
<li>Option 2/ Point 1</li>
<li>Option 2/ Point 2</li>
</ul>
</ul>

THE CODE I'M USING IS



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:param name="parent"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:for-each select="$currentPage/ancestor::root/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<ul class="select">
<xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">select current</xsl:attribute>
</xsl:if>
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" />
</xsl:attribute><xsl:value-of select="@nodeName" />
</a>
<ul class="sub">
<xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">sub_active</xsl:attribute>
</xsl:if>



<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
<xsl:attribute name="class">Selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</li>
</ul>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>



Basically I want it to itterate through the whole set and return all nodes rather than just selected page nodes.

Can any one point out

A it can't be done
B I'm stupid and should have read a faq somewhere (If so where)
C what I need to change in the above code

Cheers

Rob
Dirk
Posted: Tuesday, April 22, 2008 1:56:22 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
I'm not an expert at xslt, but I would strongly suggest to take a look at the existing template for creating a sitemap in the developer section. I guess you can reuse most of the template for your purpose.

Shoot if you have more questions.

/Dirk


level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Doogie Talons
Posted: Tuesday, April 22, 2008 2:05:40 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
yeah I thought that but i'm not understanding the structure too well as I have created the pages as such

home
this page
that page
-that pages sub page 1
-that pages sub page 2
the other page

rather than... what the site map needs

which is

home
-this page
-that page
--that pages sub page 1
--that pages sub page 2
-the other page

Thanks though I'm still working on it just wondered if any one cold see and obvious flaw.

The main question is how do you simply list sub nodes if the parent is not selected

ROb

Dirk
Posted: Tuesday, April 22, 2008 2:24:51 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
Do you mean that 'Home' and 'this page' are at the root level?

level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Doogie Talons
Posted: Tuesday, April 22, 2008 2:27:40 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Yes, HOME THIS THAT and THE OTHER are all root level or the nav was bringin up THIS THAT and THE OTHER as secondary nav
Dirk
Posted: Tuesday, April 22, 2008 2:32:59 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
Ok, to make sure I'm really following you: Those 4 nodes you mention ('Home', 'this page', 'that page' and 'the other page') are all directly under the 'Content' node in the content section, right?

Why would you want those 4 nodes at that level? Or am I still missing the point here?

/Dirk

level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Doogie Talons
Posted: Tuesday, April 22, 2008 2:37:06 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
yes they are, I wanted them root as I didn't want them as children to the home page or the would appear in the sub list where I didn't want them si there something inherantly wrong with having them like that ?
Dirk
Posted: Tuesday, April 22, 2008 3:11:14 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
Ok, understood.

You may hide certain nodes from appearing in your sub list just by creating a new general property on your document types.

Click your document type in Settings section, go to 'Properties' tab and add a new property called 'Hide from navigation' with an alias of 'umbracoNaviHide' (The alias is quite important here). Put in on the general tab and hit save. Oh, don't forget to give it the True/False datatype.

Now click your doc type again, click on 'Properties' tab and you should see the property you've just created. Set it's value to 'No' for the pages you'd like not to appear in the list.

It's generally accepted to use 'umbracoNaviHide' for this purpose. A lot of packages you may find on the net use this convention.

So,

Code:
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">


will take care selecting those nodes you wish to appear in the navigation.

As a second note, it's not a good idea to have those top level nodes. Those should be reserved in case you wish to have multiple sites in one umbraco installations. There are other reasons as well, but this would lead us too far. So I suggest you move the nodes 'this page', 'that page' (and children) and 'other page' underneath the 'Home' node.

If anything is still unclear, do not hesitate to ask.

/Dirk


level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Doogie Talons
Posted: Tuesday, April 22, 2008 3:58:58 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
No still not working.

I think the problem is this line.

<xsl:for-each select="$currentPage [@level=1]/node [string(./data [@alias='umbracoNaviHide']) != '1']">


Instead of $currentPage

is is possible to itterate through the children of the parent node you are currently itterating through

So the loop goes (In english)

Get each parent node

Loop through them

If you come across children within a node
loop through them before continuing to loop through the parents.


Rob

Dirk
Posted: Tuesday, April 22, 2008 4:13:07 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
As I do not have an umbraco install available right now, I really can't give you the exact syntax you're aiming for. I'll see if I can digg up some code tonight.

As a reminder, you will not be able to list

home
this page
that page
-that pages sub page 1
-that pages sub page 2
the other page

'this page', 'that page' and 'the other page' as long as you don't move them underneath the 'home' node.

/Dirk

level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Doogie Talons
Posted: Tuesday, April 22, 2008 4:21:50 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Cheers, I have moved everything under the homepage now Thanks.
Doogie Talons
Posted: Tuesday, April 22, 2008 6:17:33 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Ok I have managed to out put close to what I want, but I need the code to apply a different CSS for the top level if selected, and I need the code to output the home page.

This is what I am using at the moment

---

<xsl:param name="currentPage"/>
<!-- update this variable on how deep your site map should be -->
<xsl:variable name="maxLevelForSitemap" select="3"/>
<xsl:template match="/">

<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::root/node "/>
</xsl:call-template>

</xsl:template>

<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<ul class="select">

<xsl:if test="@level=2">
<xsl:attribute name="class">sub</xsl:attribute>
</xsl:if>

<xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1' and @level &lt;= $maxLevelForSitemap]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/></a>
<xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1' and @level &lt;= $maxLevelForSitemap]) &gt; 0">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
---
Its the site map, but it doesn't return the home page.

Any thoughts

Rob
Doogie Talons
Posted: Tuesday, April 22, 2008 6:40:01 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Nope.. it all fell apart at the end... the development walls are rising again, back to PHP I think Brick wall

It should be simple I just want to replicate this using umbraco.



<ul class="select"> or <ul class="select current">
<li><a href="#">Item 1</a></li>
</ul>


<ul class="select"> OR <ul class="select current">
<li><a href="#">Item 2

<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->

<ul class="sub"> OR <ul class="sub_active">
<li><a href="#">Item 2 / Option 1</a></li>
<li><a href="#">Item 2 / Option 2</a></li>
<li><a href="#">Item 2 / Option 3</a></li>
</ul>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>
</ul>

<ul class="select"> OR <ul class="select current">
<li><a href="#">Item 3</a></li>
</ul>

<ul class="select"> OR <ul class="select current">
<li><a href="#">Item 4</a></li>
</ul>



I designed the page before using umbraco and got it working in joomla first time, but I want to do this in aspx

Hope someone can offer some guidance

Rob
drobar
Posted: Tuesday, April 22, 2008 7:47:13 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,698
Location: KY, USA
Hi, Rob,

I know that xslt and xpath can be frustrating when it seems like you can be so close and yet so far away from a solution. Getting the right xpath to return the proper nodes is sometimes a challenge.

I don't have time to customize the following xslt to exactly match what you want for output, but this is the xslt that I often use as a starting point for my own navigation. Pay particular attention to the select= statements because these will dictate which nodes appear and which don't.

I've parameterized the macro so that you can either send values in through the macro itself (be sure to add the text parameters to the macro itself) or to assign smart defaults if they aren't passed through the macro.

Lastly, I use a unique handler for the home link since it is often styled differently and doing it this way simplifies the xslt.

Code:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#x00A0;">]>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:ps="urn:percipientstudios-com:xslt"
    exclude-result-prefixes="msxml umbraco.library ps">
<xsl:output method="xml" omit-xml-declaration="yes" />

<!--
======================================================================
NavigationHierarchy.xslt
======================================================================
Copyright 2008 Percipient Studios. All rights reserved.
www.percipientstudios.com
======================================================================
-->

<!-- ============================================================ -->
<xsl:param name="currentPage"/>

<xsl:variable name="startingLevel">
    <!-- what level in the content tree is the "top" of the navigation list generated? -->
    <xsl:choose>
        <xsl:when test="string(/macro/startingLevel) != ''">
            <xsl:value-of select="/macro/startingLevel"/>
        </xsl:when>
        <xsl:otherwise>1</xsl:otherwise>
    </xsl:choose>
</xsl:variable>

<xsl:variable name="stoppingLevel">
    <!-- what level in the content tree is the lowest you want to display? -->
    <xsl:choose>
        <xsl:when test="string(/macro/stoppingLevel) != ''">
            <xsl:value-of select="/macro/stoppingLevel"/>
        </xsl:when>
        <xsl:otherwise>3</xsl:otherwise>
    </xsl:choose>
</xsl:variable>

<xsl:variable name="showHome">
    <!-- show a "Home" link for the top-level node? -->
    <xsl:choose>
        <xsl:when test="string(/macro/showHome) != ''">
            <xsl:value-of select="/macro/showHome"/>
        </xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
    </xsl:choose>
</xsl:variable>

<!-- ============================================================ -->

<xsl:template match="/">

    <xsl:if test="$showHome = 1">
        <ul class="Home">
            <li>
                <xsl:if test="$currentPage/ancestor-or-self::node [@level=$startingLevel]/@id = $currentPage/@id">
                    <xsl:attribute name="class">Current</xsl:attribute>
                </xsl:if>
                <a href="/">Home</a>
            </li>
        </ul>
    </xsl:if>

    <xsl:call-template name="drawNodes">
        <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node/descendant-or-self::node [@level=$startingLevel]" />
    </xsl:call-template>
</xsl:template>

<!-- ============================================================ -->

<xsl:template name="drawNodes">
    <xsl:param name="parent" />
    <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0
        or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1
        and umbraco.library:HasAccess($parent/@id, $parent/@path) = 1)">

        <ul>
            <xsl:attribute name="class">
                <xsl:text>Level</xsl:text><xsl:value-of select="$parent/node/@level"/>
            </xsl:attribute>
            <xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1'
                        and @level &lt;= $stoppingLevel]">
                <li>
                    <xsl:if test="ps:isInList($currentPage/@path, current()/@id, ',') = 1">
                        <xsl:attribute name="class">Current</xsl:attribute>
                    </xsl:if>

                    <xsl:if test="string(data [@alias='umbracoRedirect']) != ''">
                        <a class="ExternalLink" href="{data [@alias='umbracoRedirect']}">
                            <xsl:value-of select="@nodeName" />
                        </a>
                    </xsl:if>
                    <xsl:if test="string(data [@alias='umbracoRedirect']) = ''">
                        <a href="{umbraco.library:NiceUrl(@id)}">
                            <xsl:value-of select="@nodeName" />
                        </a>
                    </xsl:if>

                    <xsl:if test="count(./node [string(./data [
                        @alias='umbracoNaviHide']) != '1'
                        and @level &lt;= $stoppingLevel
                        and ps:isInList($currentPage/@path, current()/@id, ',') = 1
                        ]) &gt; 0">
                        <xsl:call-template name="drawNodes">
                            <xsl:with-param name="parent" select="." />
                        </xsl:call-template>
                    </xsl:if>
                </li>
            </xsl:for-each>
        </ul>
    </xsl:if>
</xsl:template>
<!-- ============================================================ -->

<msxml:script language="C#" implements-prefix="ps">
<![CDATA[
public bool isInList(string sList, string sFind, string sDelim) {
    foreach (string sItem in sList.Split(sDelim.ToCharArray()[0]))
        if (sItem == sFind)
            return true;

    return false;
}
]]>
</msxml:script>

<!-- ============================================================ -->

</xsl:stylesheet>


I hope this helps. You're really not far from getting this to work from what I see.

cheers,
doug.



MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
Doogie Talons
Posted: Tuesday, April 22, 2008 8:23:40 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Thanks very much I'll spend the evening disecting that it looks like it could help greatly, more than help me with this nav but help with the whole concept of working like this.

Cheers

Rob
drobar
Posted: Tuesday, April 22, 2008 9:23:34 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,698
Location: KY, USA
Glad to help. Here's a post that looks at a different xslt problem. The post explains the xslt logic and selection process in detail, as well as links to a few other posts that do the same thing for other xslts.

http://forum.umbraco.org/yaf_postst4620_Display-top-3-news-items.aspx

You'll soon find that looping through nodes to make lists is one of the primary things you'll do in xslt. Making navigation links, sitemaps, latest news, product lists, staff directories, etc. These posts will give you some good background on how to use xslt to pull out the content you want to display.

cheers,
doug.


MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
Doogie Talons
Posted: Tuesday, April 22, 2008 10:14:21 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 35
Ok thanks Doug, I didn't use your code I amended the Navi from the creative website package with the understanding gained from your post.

The Navi now looks like this...

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:param name="parent" select="$currentPage/ancestor-or-self::root/node [@level=0]"/>
<xsl:variable name="maxLevelForSitemap" select="3"/>
<xsl:template match="/">
<!-- start writing XSLT -->

<xsl:for-each select="$currentPage/ancestor::root/node [string(./data [@alias='umbracoNaviHide']) != '1']">
    <ul class="select"><xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">select current</xsl:attribute>
</xsl:if><li>
        <xsl:if test="$currentPage/@id=current()/@id">
            <xsl:attribute name="class">Selected</xsl:attribute>
        </xsl:if>
        <a href="{umbraco.library:NiceUrl(@id)}">
            <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
            <xsl:value-of select="@nodeName" />
        </a>
    </li>
</ul>
</xsl:for-each>
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=1]/node [string(./data [@alias='umbracoNaviHide']) != '1']">
    <ul class="select"><xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">select current</xsl:attribute>
</xsl:if>
<li>
        <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
            <xsl:attribute name="class">Selected</xsl:attribute>
        </xsl:if>
        <a href="{umbraco.library:NiceUrl(@id)}">
            <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
            <xsl:value-of select="@nodeName" />
        </a>
    </li>


<xsl:if test="ancestor-or-self::node/@id = 1111 or ancestor-or-self::node/@id = 1118 ">
        
        
<ul class="sub">
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
<xsl:attribute name="class">sub_active</xsl:attribute>
</xsl:if>
<xsl:for-each select="ancestor-or-self::node [@level=2]/node [string(./data [@alias='umbracoNaviHide']) != '0']">
<li>
                <a href="{umbraco.library:NiceUrl(@id)}">
            <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
            <xsl:value-of select="@nodeName" />
        </a>
    </li>



</xsl:for-each>
</ul>
</xsl:if>
</ul>
</xsl:for-each>



</xsl:template>
</xsl:stylesheet>


Which when loaded in to the following divs in the master template as so
Code:
<div id="nav_back">
    <div id="nav">
        <?UMBRACO_MACRO macroAlias="XSLTNavi" ></?UMBRACO_MACRO>
    </div>
    </div>


along with the following CSS

Code:
#nav
{
    width:705px;
    height:30px;
    background:#fff;
    position:relative;
    }

#nav .select, #nav .current
{
    margin:0;
    padding:0;
    list-style:none;

    }

#nav li
{
    display:inline;
    margin:0;
    padding:0;
    height:auto;
    }

#nav .select a, #nav .current a
{
    display:block;
    height:30px;
    float:left;
    background:#fff;
    padding:0 10px 0 10px;
    margin:0px;
    text-decoration:none;
    line-height:30px;
    white-space:nowrap;
    border-right:1px solid #fff;
    color:#395586;
    font-weight:bold;
    }
   
* html #nav .select a, * html #nav .current a
{
    width:1px;
    height:21px;
    }

#nav .select a:hover
{   
    cursor:pointer;
    color:#395586;
    text-decoration:underline;
    background:#ebeff7;
    }
   
#nav .select li:hover a
{
    cursor:pointer;
     
    }
   

#nav .sub
{
    display:none;
   
    }

/* for IE5.5 and IE6 only */
#nav table
{
    position:absolute;
    border-collapse:collapse;
    left:0;
    top:0;
    }

#nav .current a
{
    background:#ebeff7;
    color:#395586;
    }

#nav .sub li a:hover, #nav .select a:hover .sub li a:hover, #nav .select li:hover .sub li a:hover
{
    background:#000;
    color:#808183;
    }

#nav .sub_active .current_sub a, #nav .sub_active a:hover
{
    background:#000;
    color:#808183;
    }

#nav .select li:hover .sub
{
    display:block;
    position:absolute;
    width:705px; top:30px;
    left:0;
    background:#000;
    margin-top:0;
    padding:0;
    z-index:100;
    color:#808183;
   
    }
   
    #nav .select li a:hover .sub
{
    display:block;
    position:absolute;
    width:705px; top:30px;
    left:0;
    background:#000;
    margin-top:0;
    padding:0;
    z-index:100;
    color:#808183;
    text-decoration:underline;
    }
   
   

#nav .sub, #nav .sub_active
{
    margin:0;
    padding:0;
    list-style:none;
    }

#nav .sub_active
{
    display:block;
    position:absolute;
    width:705px;
    top:30px;
    left:0;
    background:#000;
    margin-top:0; p
    adding:0;
    z-index:10;}

* html #nav .sub_active, * html #nav .select a:hover .sub
{
    z-index:-1;
    margin-top:0;
    margin-t\op:1px;
    }

#nav .sub_active a
{
    white-space:nowrap;
    display:block;
    float:left;
    background:#000;
    padding:0px 5px 5px 5px;
    margin:0;
    border:0;
    color:#808183;
    height:20px; }

#nav .select li:hover .sub li a
{
    white-space:nowrap;
    display:block;
    float:left;
    background:#000;
    padding:0px 5px 5px 5px;
    margin:0;
    border:0;
    color:#808183;
    height:20px;
    }
   
    #nav .select a:hover .sub li a
{
    white-space:nowrap;
    display:block;
    float:left;
    background:#000;
    padding:0px 5px 5px 5px;
    margin:0;
    border:0;
    color:#808183;
    height:20px;
    }




Creates a nice little drop line menu. (Where needed) The only changes I then added was to only include the nodes I needed with the statement
Code:
<xsl:if test="ancestor-or-self::node/@id = 1111 or ancestor-or-self::node/@id = 1118 ">

</xsl: if>


Around the subs just to make sure I don't include them all.

Thanks for everyones help.

I'll be working on the Firefox exceptions tomorrow

Cheers

Rob
Dirk
Posted: Tuesday, April 22, 2008 10:54:52 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
Ok, I see I do not have to post my code snippet, as you've already found what you needed! Applause

Great, now you will actually start to love xslt, right?

Grzt,
/Dirk


level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.