custom menu in 4.1
I am looking for some advice as far as custom menus go in SiteFinity. This is our first project with SF so we are still in our infancy of knowledge with the product. We have had our designer try to use the horizontal with dropdowns, along with the custom menu over-ridding css. We briefly looked at the tree navigation, there are a lot of unneeded elements in the tree nav. So I am wondering what would be the best way to get a custom navigation working with exact styling. I feel like there should be a way to do a repeater within a repeater and just pull two data calls. I have implemented this menu http://www.fortwaynewebdevelopment.com/custom-navigation-menu-in-sitefinity-4/ the things I am missing on this menu are
1. second tier nav
2. knowing that when binding the tier 1 nav that a child page within is selected
Hello Adrienne,
The PageNode has a property Nodes that you can use to check of there are child nodes and add them to the datasource. Another option is using the binding to arraylist,generic list or an array using one of the RadControls( here is a sample with RadTreeView)
You can easily get the selected node using SiteMapBase.GetActuallCurrentNode and then perform the binding.
Regards,
Ivan Dimitrov
the Telerik team
Um, the original link above no longer works. I've asked a similar question on this thread:
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/developing-with-sitefinity/simple-ul-gt-li-gt-a-list-of-pages.aspx
Hi Dan,
Have you tried to search for the control on the Marketplace?
www.sitefinity.com/.../search-results.aspx
result
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Ivan,
Yes, I did find that control and I'm now using it. I updated my own question thread that I linked to above. It would be nice to find the source code for that type of control for additional customization, but as is, it works pretty well.
When I get back in the office next week I'll post my custom 2 tier menu Cheers
This was an example so please double check any code if used in production
<asp:SiteMapDataSource ID="TopNavStart" runat="server" ShowStartingNode="false" />
<asp:Repeater runat="server" ID="LeftNav" DataSourceID="TopNavStart" OnItemDataBound="FirstLevel_ItemDataBound">
<HeaderTemplate>
<ul id="nav">
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="litLIHolder" runat="server" /><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' Text='<%# Eval("Title") %>' />
<asp:Repeater ID="LeftSubNav" runat="server">
<HeaderTemplate>
<ul class="sub_nav">
</HeaderTemplate>
<ItemTemplate>
<li>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' Text='<%# Eval("Title") %>' />
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
Dan,
Send over an email to cwoodard@apterainc.com - I'm sure we could provide the code for our CleanNav control to you for customization as it is a free control. As long as it isn't redistributed :)