I take the XSLT file topNavigation.xslt from the libary and make a macro. I insert the macro but it only works for page 1 showing suppage 1 and suppage 2.
How can I make it show pages at the same level as my startpage.
My inserted XSLT is below looks like this and it is standard Umbraco template XSLT.
In my opinion you should (if you're not too far down the road) change the structure of your site to:
--- start (home)
--------- page 1
--------------- subpage 1
--------------- supbage 2
--------- page 2
--------- page 3
This will mean that all the default scripts will run much nicer, the way your structure is set up at the moment will cause you no end of problems (in my opinion).
I am shure that making another level will make a solution but it must be possible to include the "start" page in a XSLT generated menu. I would still like to know how!
Hey. Can anyone explain me how to start a new topic in the Umbraco forum? It should be quite straightforward but I am lost. I have an Umbraco forum profile already. Regards, Lars
Getting XSLT links at the same level as "start"
Hello. I am brand new to XSLT.
I have a homepage with the following structure
- start
- page 1
- subpage 1
- supbage 2
- page 2
- page 3
I take the XSLT file topNavigation.xslt from the libary and make a macro. I insert the macro but it only works for page 1 showing suppage 1 and suppage 2.
How can I make it show pages at the same level as my startpage.
My inserted XSLT is below looks like this and it is standard Umbraco template XSLT.
Any help will be appreciated.
Thanks in advance and regards
Lars
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Hey Lars,
In my opinion you should (if you're not too far down the road) change the structure of your site to:
--- start (home)
--------- page 1
--------------- subpage 1
--------------- supbage 2
--------- page 2
--------- page 3
This will mean that all the default scripts will run much nicer, the way your structure is set up at the moment will cause you no end of problems (in my opinion).
Rich
Hi Rich
Thank you for your quick answer.
I am shure that making another level will make a solution but it must be possible to include the "start" page in a XSLT generated menu. I would still like to know how!
Lars
Change the variable to 0 I think.
Rich
YES tbe code below works. It helps to look at what other and wiser people have done, so I fount the solution at http://our.umbraco.org/forum/using/ui-questions/16583-Need-help-with-sub-navigation-XSLT
But thank you anyway Rich for your help!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<xsl:variable name="rootNode" select="$currentPage/ancestor-or-self::*[@level=1]" />
<xsl:template match="/">
<ul id="subMenu">
<li>
<a href="{umbraco.library:NiceUrl($rootNode/@id)}">
<xsl:value-of select="$currentPage/ancestor-or-self::*[@level = '1']/@nodeName"/>
</a>
</li>
<xsl:apply-templates select="$rootNode/*[@isDoc and string(umbracoNaviHide) != '1']"/>
</ul>
</xsl:template>
<xsl:template match="*[@isDoc and string(umbracoNaviHide) != '2']">
<xsl:variable name="id" select="id" />
<li class="subNiveau">
<xsl:attribute name="class">subNiveau<xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id"> current</xsl:if></xsl:attribute>
<a href="{umbraco.library:NiceUrl(./@id)}">
<xsl:value-of select="@nodeName" />
</a>
</li>
<xsl:if test="count(./*[@isDoc and string(umbracoNaviHide) != '1']) > 0 and count(descendant-or-self::*[@id = $currentPage/@id]) > 0">
<li class="nav">
<ul>
<xsl:apply-templates select="./*[@isDoc and string(umbracoNaviHide) != '1']" />
</ul>
</li>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Hey. Can anyone explain me how to start a new topic in the Umbraco forum? It should be quite straightforward but I am lost. I have an Umbraco forum profile already. Regards, Lars
Hey Lars,
First you select the category on this page
Then you get to this page where you can see the 'Create a new topic' button
Hope this helps.
Rich
Hey Rich
Thank you very much and yes, it helped me. Now I just need to learn the rest of Umbraco :-).
Lars
is working on a reply...