Asked by:
Menu Adapter, SiteMap file Horizontal Display..

Question
-
User-364224307 posted
Is it possible to create a horizontal menu using the below sitemap file? The menu should display...
Home Test Projects
>Project 1
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="~/" title="Home" description="Home">
<siteMapNode url="~/Page1.aspx" title="Test" description="Test" />
<siteMapNode url="" title="Projects" description="Projects">
<siteMapNode url="" title="Project 1" description="Project 1" />
</siteMapNode>
</siteMapNode>
</siteMap>The problem with the current sitemap is that the css menu adapter will display the menu vertically since everything is under the top "Home" node. I can work around this using the following sitemap and setting ShowStartingNode="False" is the SiteMapDataSouce control.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="~/" title="Home" description="Home">
<siteMapNode url="~/Default.aspx" title="Home" description="Home" />
<siteMapNode url="~/Page1.aspx" title="Test" description="Test" />
<siteMapNode url="" title="Projects" description="Projects">
<siteMapNode url="" title="Project 1" description="Project 1" />
</siteMapNode>
</siteMapNode>
</siteMap>Am I missing something or is this just the way the css menu adapter works? Thanks.
Thursday, January 10, 2008 4:40 PM
All replies
-
User-1360041575 posted
You can set the Menu control Orientation Property to Horizontal. It is Vertical by default.
Thursday, January 10, 2008 4:44 PM -
User368629139 posted
If you want your menu to display without the home node you need to set the Static Display Levels. I think in your case you'd set it to 2
Thursday, January 10, 2008 4:46 PM -
User-364224307 posted
I do have the orientation of my menu control set to "Horizontal" (code below). However, the menu appears vertically since the sitemap must have 1 root sitemapNode with all other siteMapNodes contained under the root.
<asp:Menu ID="mnuHeader" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
SkipLinkText="" StaticDisplayLevels="2" MaximumDynamicDisplayLevels="2" cssselectorclass="PrettyMenu"/>
Thursday, January 10, 2008 4:49 PM -
User1407569999 posted
In your sitemapdatasource you have numerous options as to where to start parsing. Check out its properties.
Thursday, January 10, 2008 4:50 PM -
User-364224307 posted
noahb,
I'm not sure this is a parsing problem. I want to start parsing at <siteMapNode url="~/" title="Home" description="Home">. But, I don't want the remaining nodes to fall vertically under the root Home node.My menu should be.....Home Test Projects (Project 1 will fall under Projects). If I remove the css adapter, the menu that is displayed correctly. If I apply the adapter, the menu appears vertically.
Thursday, January 10, 2008 4:56 PM -
User368629139 posted
I was having the exact same issue and setting the StaticDisplayLevels property to 2 solved this problem for me
Thursday, January 10, 2008 5:04 PM -
User-364224307 posted
Also, I would just like to state I can create the correct menu using the sitemap below, but the SiteMapPath will always show "Home > Home" on Default.aspx. This isn't a huge problem just annoying.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="~/" title="Home" description="Home">
<siteMapNode url="~/Default.aspx" title="Home" description="Home" />
<siteMapNode url="~/Page1.aspx" title="Test" description="Test" />
<siteMapNode url="" title="Projects" description="Projects">
<siteMapNode url="" title="Project 1" description="Project 1" />
</siteMapNode>
</siteMapNode>
</siteMap>Thursday, January 10, 2008 5:07 PM -
User-364224307 posted
Rodashar...I would like my Home node to displayed. Is your home node displayed? Is is not displaying for me when I set the staticDisplayLevels to 2.
Thursday, January 10, 2008 5:09 PM -
User368629139 posted
My home node is not displayed. I must have misunderstood your question :P
Thursday, January 10, 2008 5:14 PM -
User-1360041575 posted
.Thursday, January 10, 2008 5:30 PM -
User1407569999 posted
well the Title for "~/" and for "~/Default.aspx" are both "Home" so you'll see "Home > Home" You might want to choose between one of these.
Thursday, January 10, 2008 5:48 PM -
User-1360041575 posted
If you get rid off the siteMapNode that is pointing to Default.aspx and change the root siteMapNode ' url to url="~/Default.aspx". You should not see Home twice. And, Change: ShowStartingNode="False" To: ShowStartingNode="True"Thursday, January 10, 2008 5:48 PM