Welcome Guest Search | Active Topics | Sign In | Register

SiteMapDataSource Options
sward4
Posted: Wednesday, December 5, 2007 5:52:38 AM
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
eo_support
Posted: Wednesday, December 5, 2007 6:04:19 AM
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
sward4
Posted: Wednesday, December 5, 2007 6:23:38 AM
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
eo_support
Posted: Wednesday, December 5, 2007 7:40:00 AM
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
sward4
Posted: Wednesday, December 5, 2007 7:45:47 AM
Rank: Member
Groups: Member

Joined: 6/27/2007
Posts: 15
Many thanks I will give this a whirl.

Steve
sward4
Posted: Wednesday, December 5, 2007 8:34:24 AM
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
eo_support
Posted: Wednesday, December 5, 2007 8:46:59 AM
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
sward4
Posted: Wednesday, December 5, 2007 8:52:37 AM
Rank: Member
Groups: Member

Joined: 6/27/2007
Posts: 15
They are totally gone and the header doesn't show.

Steve
eo_support
Posted: Wednesday, December 5, 2007 8:56:10 AM
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
sward4
Posted: Wednesday, December 5, 2007 9:02:47 AM
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
eo_support
Posted: Wednesday, December 5, 2007 12:09:10 PM
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
sward4
Posted: Wednesday, December 5, 2007 3:26:38 PM
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
sward4
Posted: Thursday, December 6, 2007 3:09:50 AM
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
sward4
Posted: Thursday, December 6, 2007 4:13:00 AM
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
eo_support
Posted: Thursday, December 6, 2007 7:08:20 AM
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.
sward4
Posted: Thursday, December 6, 2007 7:16:19 AM
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
eo_support
Posted: Thursday, December 6, 2007 7:19:32 AM
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.
sward4
Posted: Thursday, December 6, 2007 10:19:52 AM
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
sward4
Posted: Friday, December 7, 2007 4:06:46 AM
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
eo_support
Posted: Friday, December 7, 2007 6:49:28 AM
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


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.