|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
I am using a Web.sitemap and SiteMapDataSource and trying to get the Category headers working in a Slide Menu.
I want to do this sort of thing:-
<category title="Hardware"> <category title="Desktop" url="~/desktop.aspx"> <category title="Complete Systems" url="~/systems.aspx" /> <category title="Barebone Systems" url="~/barebones.aspx" /> <category title="Accessories" url="~/accessories.aspx" /> </category>
but with a sitemap, but the worked example shows:
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"> <siteMapNode url="Default.aspx" title="Default" description=""> <siteMapNode url="Page1.aspx" title="Page 1" description="" roles="role1"/> <siteMapNode url="Page2.aspx" title="Page 2" description="" roles="role2"/> <siteMapNode url="Page3.aspx" title="Page 3" description=""/> </siteMapNode> </siteMap>
How do you get a section header which slides below when you click it and reveals the links below it, and still use a sitemap. I would be grateful of any help.
Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I am not sure if I got your question correctly. With a site map, you would first set up your SiteMapDataSource, then set your slide menu's DataSourceID to the ID of the data source control.
Thanks
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Hi,
Yes I am currently using the Menu but want to convert to a Slide Menu. All I am asking is what to insert into the sitemap to create the headers (categories) for each section. They wont be a link but will reveal the slide down to show that section when clicked. Like the Pthalo example.
Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
It's the same for menu and slide menu. Just do:
<SiteMapNode title="header"> <siteMapNode url="Default.aspx" title="Default" description=""> </SiteMapNode>
Thanks
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Many thanks I will give this a whirl.
Steve
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
When I do this it just hides the siteMapNode's which are within the header?
Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
What do you mean by "hides the nodes"? Do you mean they are collapsed or they are totally gone? If they are collapsed, then that's normal. You need to click the header to expand them. Or you can manually set the first node's Selected to true to expand it:
Code: C#
//Build the menu from your site map
SlideMenu1.DataBind();
//Expand the first header
SlideMenu1.Items[0].Selected = true;
Thanks
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
They are totally gone and the header doesn't show.
Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Steve,
Without seeing your code I do not know why it does that. Our slide menu works the same way as ASP.NET menu, so you can try to get it working with ASP.NET Menu first (for which you should be able to find some sample code online), once you get it working with ASP.NET Menu, you can just set our slide menu's DataSourceID and everything should just work.
Thanks
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Hi,
Thanks, I have included a bit of the sitemap below and I have done exactly what you have said. I am currently using a Menu and have substituted it for a Slide Menu using the same SiteMapDataSource. I use Visual Studio 2005 so have just added into a master page as I did with the Menu.
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" enableLocalization="true" >
<siteMapNode url="~/eGAP/eTNA/Default.aspx" title="Home">
<siteMapNode url="~/eGAP/eTNA/MyInformation.aspx" resourceKey="MyInformation" /> <siteMapNode url="~/eGAP/eTNA/Admin/ManageWorkshops.aspx" resourceKey="ManageWorkshops" />
<siteMapNode title="header" resourceKey="Header" > <siteMapNode url="~/eGAP/eTNA/Admin/WorkshopEvaluation.aspx" resourceKey="WorkshopEvaluation" /> <siteMapNode url="~/eGAP/eTNA/Admin/WorkshopScores.aspx" resourceKey="WorkshopScores" /> <siteMapNode url="~/eGAP/eTNA/Admin/LatestLogins.aspx" resourceKey="LatestLogins" /> </siteMapNode>
<siteMapNode url="~/eGAP/eTNA/Admin/TEN_OPQ_Scores.aspx" resourceKey="TEN_OPQ_Scores" /> <siteMapNode url="~/eGAP/eTNA/Sponsor/CurrentCapability.aspx" resourceKey="CurrentCapability" /> <siteMapNode url="~/eGAP/eTNA/Sponsor/CapabilityComparisons.aspx" resourceKey="CapabilityComparisons" /> <siteMapNode url="~/eGAP/eTNA/Sponsor/ExternalPerspective.aspx" resourceKey="ExternalPerspective" /> <siteMapNode url="~/eGAP/eTNA/Sponsor/WorkshopsAttended.aspx" resourceKey="WorkshopsAttended" />
</siteMapNode> </siteMap>
Regards, Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
There are two problems in your site map file:
1. <siteMapNode url="~/eGAP/eTNA/Default.aspx" title="Home"> can not have a url option. The reason is a slide menu header item is expanded when it clicks. However, if you have a Url associated with it, the item would navigate the browser to another page, which means the slide menu never get a chance to expand;
2. For all the children nodes, you need to have a "title" attribute. The reason that none of them show up in the menu is because there is no menu item text to display. So slide menu skips them;
Thanks
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Hi - thanks for your continued support.
1. This is the top node whish is not used so I can change this.
2. The child nodes show up when they are not wrapped by the "default" node we added today. The title comes from a resource file as the application is multi-language and was all working well before the change to slide-menu. The nodes outside of the 'new' section work fine still
I will test tomorrow (late here) and report back thanks.
Steve
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
No joy! but could it be because I have set the properties of SiteMapDataSource to not show the starting node i.e. ShowStartingNode = False ?
Steve
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
I have used your example and modified to this:
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"> <siteMapNode url="Default.aspx" title="Default" description=""> <siteMapNode url="Page1.aspx" title="Page 1" description="" roles="role1"/> <siteMapNode title="Page 2" description="" roles="role2" > <siteMapNode url="Page4.aspx" title="Page 4" description="" roles="role4"/> <siteMapNode url="Page5.aspx" title="Page 5" description="" roles="role5"/> </siteMapNode> <siteMapNode url="Page3.aspx" title="Page 3" description=""/> </siteMapNode> </siteMap>
This shows page 1 and 3 only with ShowStartingNode = False
Regards, Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
sward4 wrote:I have used your example and modified to this:
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"> <siteMapNode url="Default.aspx" title="Default" description=""> <siteMapNode url="Page1.aspx" title="Page 1" description="" roles="role1"/> <siteMapNode title="Page 2" description="" roles="role2" > <siteMapNode url="Page4.aspx" title="Page 4" description="" roles="role4"/> <siteMapNode url="Page5.aspx" title="Page 5" description="" roles="role5"/> </siteMapNode> <siteMapNode url="Page3.aspx" title="Page 3" description=""/> </siteMapNode> </siteMap>
This shows page 1 and 3 only with ShowStartingNode = False
Regards, Steve I have already pointed out for the root node you can not have an url attribute. It's the same problem again.
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Hi,
I tried both but get nothing when this has no URL. Have you got an example which you have built in Visual Studio using a sitemap.
Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
We tried the exact same sitemap you posted with the root node's url removed. And everything works fine here. So you may want to try it in a separate project.
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Hi,
That worked!!! I will format etc in the project and then try and copy into the original app. Thanks for your patience :)
Regards, Steve
|
|
Rank: Member Groups: Member
Joined: 6/27/2007 Posts: 15
|
Hi,
When I move the exact same sitemap to the existing App and copy and paste the exact script for the SlideMenu and also the resource file which was working in the test App, guess what! doesn't display the Slide Menu. Can you think of any reason that it doesn't display (both in Master pages with resource files which worked in test environment). Could it be a licensing issue. I bought the Menu license - do I need to buy the Slide Menu license?
Steve
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Steve,
You do need a separate license (or the suite license) for slide menu. However whether it's licensed or not does not affect data binding.
We do not do anything special about site map. We use SiteMapDataSource to read the nodes, and if it gives us nodes, we display it, if it doesn't we don't. So the issue is really inside your project/site map. My guess is that it has to do with your localization stuff. Unfortunately we don't know more on that.
Thanks
|
|