Recently installed Umbraco - Top navigation not displayed
Hi there,
I have recently installed and configured Umbraco. However the top navigation menu does not display on the site. I have checked the that the Runway Top Navigation module under Developer -> Installed Packages is installed. Just to make sure I uninstalled the module and re-installed this, but to no avail.
Can someone please help me. I am a complete newbie to Umbraco and would appreciate any help/advice. Thanks.
Have you installed the top navigation package after you installed the runway package? In that case, you probably need to insert the top navigation macro in your master template.
You can do this by going to the Settings section, and clicking yous Master template under the Templates-folder. When you have opened the Master tempalte, click the place in the code where you want to insert the menu and then click the "Insert macro"-button. Now you select the top navigation macro, and presses OK or whatever that button is called.
When the macro is inserted you save the template, and then you should be good to go.
Hi Praveen, if you want t have a standard top navigation, you can just go to the developer section and create a new XSLT-file. Call it something like TopNavigation, and base it on the navigation template. This should do the trick, and then you've got a great working top navigation :)
As advised I created TopNavigation.xslt based on "Navigation Prototype" template and then I have inserted the macro
<umbraco:Macro Alias="TopNavigation" runat="server"></umbraco:Macro> in my master template. But this does not work,
am I missing something or have not installed something, like you have advised Swetha to install "top navigation package" if I need to install something like this for 4.7 then can you please provide the link.
<!-- 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> <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">active</xsl:attribute> </xsl:if> <xsl:if test="position()=last()"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">last</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul>
The reason why you are not getting anything displayed is that your structure is different from the "normal" way of structuring the nodes in Umbraco.Usually the structure looks somehting like this:
-Content
--Home
---Resources
---FAQ
etc.
If your're ging for your structure try changing the code to this:
<xsl:variable name="root" select="$currentPage/ancestor-or-self::root" /> <xsl:template match="/"> <!-- The fun starts here --> <ul> <xsl:for-each select="$root/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">active</xsl:attribute> </xsl:if> <xsl:if test="position()=last()"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">last</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul> </xsl:template>
Great to hear that it worked. It looks like Dirk has already answered you in that post. But I'll keep an eye out for that post, if there's further questions, or it still doesn't work :)
Recently installed Umbraco - Top navigation not displayed
Hi there,
I have recently installed and configured Umbraco. However the top navigation menu does not display on the site. I have checked the that the Runway Top Navigation module under Developer -> Installed Packages is installed. Just to make sure I uninstalled the module and re-installed this, but to no avail.
Can someone please help me. I am a complete newbie to Umbraco and would appreciate any help/advice. Thanks.
Hi Shwetha
Have you installed the top navigation package after you installed the runway package? In that case, you probably need to insert the top navigation macro in your master template.
You can do this by going to the Settings section, and clicking yous Master template under the Templates-folder. When you have opened the Master tempalte, click the place in the code where you want to insert the menu and then click the "Insert macro"-button. Now you select the top navigation macro, and presses OK or whatever that button is called.
When the macro is inserted you save the template, and then you should be good to go.
Does this help?
/Kim A
Thanks Kim. That worked like a charm!
You are very welcome Shwetha. Glad you got it sorted out!
Could you mark this issue as solved, so that anyone else going through the forum posts, can see that this is no longer an open issue?
/Kim A
Hi There
I have installed UMBRACO 4.7 and want to install "top navigation package" can you please provide the link to download this package please.
Thanks
Praveen
Hi Praveen, if you want t have a standard top navigation, you can just go to the developer section and create a new XSLT-file. Call it something like TopNavigation, and base it on the navigation template. This should do the trick, and then you've got a great working top navigation :)
/Kim A
Hi Kim
Umbraco version: 4.7
As advised I created TopNavigation.xslt based on "Navigation Prototype" template and then I have inserted the macro
<umbraco:Macro Alias="TopNavigation" runat="server"></umbraco:Macro> in my master template. But this does not work,
am I missing something or have not installed something, like you have advised Swetha to install "top navigation package" if I need to install something like this for 4.7 then can you please provide the link.
Kind Regards
Praveen
Hey Praveen check this post http://our.umbraco.org/forum/developers/xslt/22326-UMBRACO-47-Top-Navigation?p=0#comment83988
Praveen, could you show us the structure of your content, and also the xslt-code that's being used in the topNavigatin.xslt?
/Kim A
Hi Kim
Umbraco version 4.7
From the website the menu looks like this
Home | Resources | Other Links | NZ FGM Programme | Contact
Screen shot for the content tab
XSLT CODE
<?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"/>
<!-- 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>
<xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
<!-- we're under the item - you can do your own styling here -->
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<xsl:if test="position()=last()">
<!-- we're under the item - you can do your own styling here -->
<xsl:attribute name="class">last</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Please help
The reason why you are not getting anything displayed is that your structure is different from the "normal" way of structuring the nodes in Umbraco.Usually the structure looks somehting like this:
-Content
--Home
---Resources
---FAQ
etc.
If your're ging for your structure try changing the code to this:
Does that make a difference?
/Kim A
Hey Kim COOL AS it worked like a charm
many thanks for your help mate, what is your email id please let me know
Praveen
[email protected]
Hi Kim
Can you please help with this thread if you have time please
http://our.umbraco.org/forum/developers/api-questions/22457-Umbraco-47-sitemap-not-working
Kind Regards
Praveen
Hi Praveen
Great to hear that it worked. It looks like Dirk has already answered you in that post. But I'll keep an eye out for that post, if there's further questions, or it still doesn't work :)
/Kim A
is working on a reply...