Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I have used the jQuery plugin "Superfish" together with an EPiServer-generated unordered list to create a drop-down menu, and it looks quite nice and works well. Have a look how to apply it to your code here:
http://users.tpg.com.au/j_birch/plugins/superfish/
The following is the menu.ascx code.
<EPiServer:MenuList runat="server" ID="Menu">
<HeaderTemplate>
<ul id="MainMenu">
</HeaderTemplate>
<ItemTemplate>
<li>
<EPiServer:PageList runat="server" ID="PageList1" DataSource="<%#Container.CurrentPage.PageLink %> ">
<ItemTemplate>
<li>
<EPiServer:Property ID="Property1" PropertyName="PageLink" runat="server" />
</li>
</ItemTemplate>
</EPiServer:PageList>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</EPiServer:MenuList>
The following is Menu.ascx.cs
protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);
Menu.PageLink = PageReference.StartPage;
Menu.PageLoader.GetChildrenCallback = new HierarchicalPageLoader.GetChildrenMethod(LoadChildren);
Menu.DataBind();
}
/// <summary>
/// Creates the collection for the main menu, adding the startpage
/// </summary>
private PageDataCollection LoadChildren(PageReference pageLink)
{
PageDataCollection pages = DataFactory.Instance.GetChildren(pageLink);
pages.Insert(0, DataFactory.Instance.GetPage(pageLink));
return pages;
}
/// <summary>
/// Gets or sets the MenuList for this control
/// </summary>
public MenuList MenuList
{
get { return Menu; }
set { Menu = value; }
}
pls help.Thanks in advance.I am getting all the menu items in a single list,Including sub menu