This is a migrated thread and some comments may be shown as answers.

Issues with sitemaps

6 Answers 95 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 2
Peter asked on 12 Jan 2012, 01:55 PM
Hi there,

Im currently using the RadPanelBar and RadMenu as navigation on my website. They are both using the same datasource (see sitemap). For the radMenu I want to be able to click on the administrator/broker manager node and have it take me to the default page for that section. I thought I could just put the default.aspx url in the upper node, but I realised that all the urls have to be unique.At the moment, clicking on either the Administration or Broker Manager nodes takes the user to a directory listing. Is there a way around this? I have attached pictures to better explain what Im doing.

Thanks for your time!

Peter


<?xml version="1.0" encoding="utf-8" ?>
    <siteMapNode url="/Views/" title=""  description="">
        <siteMapNode url="/Views/BrokerManager/" title="Broker Manager">
            <siteMapNode url="/Views/BrokerManager/BrokerManager/" title="Broker Manager">
                <siteMapNode url="/Views/BrokerManager/BrokerManager/Default.aspx" title="Brokers" />
                <siteMapNode url="/Views/BrokerManager/BrokerManager/OfficeList.aspx" title="Offices" />
            </siteMapNode>
        </siteMapNode>
        <siteMapNode url="/Views/Administration/" title="Adminstration" >
            <siteMapNode url="/Views/Administration/UserManagement/" title="User Management" description="">
                <siteMapNode url="/Views/Administration/UserManagement/Default.aspx" title="Users" />
                <siteMapNode url="/Views/Administration/UserManagement/Roles.aspx" title="Roles" />
            </siteMapNode>
            <siteMapNode url="/Views/Administration/Subscribers/" title="Subscriber Management" description="">
                <siteMapNode url="/Views/Administration/Subscribers/Default.aspx" title="Subscribers" />
            </siteMapNode>
        </siteMapNode>
    </siteMapNode>
</siteMap

6 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 2
answered on 17 Jan 2012, 10:30 AM
Hit there,

Its been 5 days since I've posted this, could someone please respond to this post?

Thanks
0
Kate
Telerik team
answered on 17 Jan 2012, 10:48 AM
Hello Peter,

Indeed the .NET Framework requires URL's to be unique because behind the scenes it stores SiteMapNodes in a Dictionary object in memory. However, you can get around this requirement by appending parameters to your URLs (e.g. Default.aspx?1, and Default.aspx?2)

All the best,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Peter
Top achievements
Rank 2
answered on 17 Jan 2012, 12:46 PM
Hi Kate,

Thanks for your response! Although this technique works, the RadPanel on the left interprets this as being on the upper node (see NewBroker.jpg). I realise Panel is behaving the way it should, I was just hoping there was some way of getting it to display the node of my choice (as .rpSelected) without resorting to a redirect. Is it perhaps possible to achieve this through some jigging in the code behind?
0
Kate
Telerik team
answered on 19 Jan 2012, 03:06 PM
Hi Peter,

There are two approaches that I could come up with - the first one is to apply a CssClass property on ItemDataBound that will apply the .rpSelected class:
protected void RadPanelBar1_ItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
        {
            SiteMapNode node1 = (SiteMapNode)e.Item.DataItem;          
            e.Item.CssClass = node1["CssClass"];
        }

The second one is to use the PersistStateInCookie property as demonstrated in our online demo.

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Jacques
Top achievements
Rank 2
answered on 19 Jan 2012, 03:33 PM
Hi Kate,

I'm not sure we're on the same page here. I want to try and explain this again perhaps it will help.

If you look at Peter's attached images you will notice 2 primary menu items 1) Broker Manager and 2) Administration. You will also see the secondary/tertiary navigation on the left side below the page title. I say secondary and tertiary, because that's how it's represented, but in this case the secondary portion, or nodes, are just groupings for the tertiary menus. In other words they will never be pages themselves. What we need is the following:
1. When you click on Broker Manager the site should redirect to the tertiary menu Brokers
2. The brokers menu should be highlighted by default
3. The secondary navigation items (or the grouping panels) should never have any form of highlighting applied because they're just groupings.

In the past we have managed to get around this by creating a sitemap and multiple URLs and perhaps differentiating duplicate URLs by adding query strings to them. The problem in this case is that the panel, or grouping bar, seems to be behaving like a default whereby if the Broker tertiary menu does not Exactly match the given URL then the panel grouping bar becomes active.

Perhaps the panel bar is not the optimal choice? I can't see how the panel bar was meant to work if it can't do this... or is it a case that the Panel bar is just not suited to menus?

Regards,
Jacques
0
Kate
Telerik team
answered on 21 Jan 2012, 01:30 PM
Hi Jacques,

As far as I can understand from your post you need that none of the RadPanelItems (on the left side ex:Brokers, Offices) to be highlighted at all. If this is the case, my previously suggested approach could be helpful though I am not completely sure that I understand the entire logic of your application.  Refer to the attached project that demonstrates the suggested approach with applying the CssClass property to the desired items. In this example I use RadPanelBar that I bind to a SiteMapDataSource and assign a CssClass property to every item. In your case, you can assign a CssClass and add the necessary properties only to the desired items (the ones with text Brokers and Offices). Of course in the implementation of these css classes you will need to get the correct css class selector so that you can remove the highlighting style.

Another approach (very similar to the one mentioned above) could be to remove the highlighting style using the appropriate css class selector , using the Office2007 skin, this would be:

div.RadPanelBar_Office2007 .rpGroup a.rpLink,
 div.RadPanelBar_Office2007 .rpGroup .rpOut {
      background-image: none;
}

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
PanelBar
Asked by
Peter
Top achievements
Rank 2
Answers by
Peter
Top achievements
Rank 2
Kate
Telerik team
Jacques
Top achievements
Rank 2
Share this question
or