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

How to Remove root level List Library Discussions from menu

3 Answers 138 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Daniel Lisowski
Top achievements
Rank 1
Daniel Lisowski asked on 13 Apr 2011, 07:48 PM
We are creating a dynamically created menu based off the DataSourceID="SiteMapDataSource" property. While this gives us the functionality we wanted it also displays LISTS, LIBRARIES and DISCUSSIONS on the top-level navigation. We only want to have top-level sites on the home page and sibling sub-sites displayed on the landing page of sub-sites. We have removed the Quick Launch to gain valuable real estate and therefore need to display the LISTS, LIBRARIES and DISCUSSIONS underneath a site menu item as a drop-down item. How do we accomplish this? I have attached a screenshot of our current site menu which displays ALL of the sitemap content in the top-level navigation. How do we move the LISTS, LIBRARIES and DISCUSSIONS into a separate drop-down? I have also attached 2 more images called "telerik_menu_dropdown.gif" which displays the menu items we need removed from the root menu and then image attachment named "telerik_menu_subsite_sample.gif" which is a child site of the parent. This top-level navigation is displayed correctly with all of the menu items listed vertically inside a drop-down menu.

Thanks
Alex

3 Answers, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 19 Apr 2011, 01:07 PM
Hello Daniel Lisowski,

I started investigating the issue, but I am afraid that I will need some more time.
Thank you for your patience.

Greetings,
Kalina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Daniel Lisowski
Top achievements
Rank 1
answered on 25 Apr 2011, 05:41 PM
Ok, thank you for the reply. Could you update me with an estimated time frame? Can you provide any thoughts you have on the menu even if you don't have a complete solution yet? That way I could begin working on your suggestions and assist in coming up with a solid solution.

Thanks,
Alex
0
Kalina
Telerik team
answered on 26 Apr 2011, 09:41 AM
Hi Daniel Lisowski,

I tried various ways to implement the RadMenu appearance and functionality that you describe.

It seems that the easiest way to achieve it is to make use of RadMenu ItemTempates.
Let me suggest you enumerate the Lists and Libraries of the current web site(and/or web site collection) manually and add links to these items in this way:
<telerik:RadMenu runat="server" id="RadMenu1"  width="880px" height="60px">
    <Items>
        <telerik:RadMenuItem Text="Product ABC" PostBack="false"  >
            <Items>   
            <telerik:RadMenuItem Text="link1">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="link1">
            </telerik:RadMenuItem>   
                <telerik:RadMenuItem  Width="500px" Text="Lists:" >
                    <ItemTemplate>
                        <div id="CatWrapper" class="Wrapper" style="width:800px;">
                        Current web site lists:   <br />
                               <asp:Label ID="Label1" runat="server"></asp:Label>
                               <br />
                               Current web site libraries: <br />
                               <asp:Label ID="Label2" runat="server"></asp:Label>
                        </div>
                    </ItemTemplate>
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

protected void Page_Load(object sender, EventArgs e)
        {
            RadMenuItem colorItem = RadMenu1.FindItemByText("Lists:");
            Label Label1 = (Label)colorItem.FindControl("Label1");
            Label Label2 = (Label)colorItem.FindControl("Label2");
 
            
   // please change the URL here to the site/site collection URL that you use
            string webUrl = "http://testpc-spvs2010/ASP.NET-AJAX-CONTROLS";
 
            using (SPWeb oWebsite = new SPSite(webUrl).OpenWeb())
            {
                SPListCollection collList = oWebsite.Lists;
 
                for (int j = 0; j < collList.Count; j++)
                {
                    
                    if (!collList[j].Hidden && collList[j].BaseType == SPBaseType.GenericList)
                    {                      
                        Label1.Text += "<a href='" + collList[j].DefaultViewUrl + "' >" + collList[j].Title + "</a><br/>";
                    }
                    if (!collList[j].Hidden && collList[j].BaseType == SPBaseType.DocumentLibrary)
                    {                     
                        Label2.Text += "<a href='" + collList[j].DefaultViewUrl + "' >" + collList[j].Title + "</a><br/>";
                    }
 
                }
            }
 
 
 
        }

The case with the current site collection is similar.
I understand that the requirements that you have to comply with can change, but I believe that this sample will help you get started.
I prepared an example for you based on our RadMenu Mega Drop-Down online demo - please note that you will have to style this example in order to make it fit your page design.

All the best,
Kalina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Menu
Asked by
Daniel Lisowski
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Daniel Lisowski
Top achievements
Rank 1
Share this question
or