Layout Template has no effect on Duplication Navigation control in Toolboxes
Hi there,
I have a duplicate navigation control that must be used on various pages, but it has to also make use of a custom layout which is done in a separate ascx control.
If I manually add a normal navigation control to page and edit it's custom layout property, it works and applies the custom template, but...
If I go to Administration > Settings > Advanced > Toolboxes > Page Controls > Sections > NavigationControlSection > Tools and I make a copy of the original navigation control and in the new copy I apply the same path to the custom layout, it doesn't work.
The description for this field in the Administration section says the following: "Specifies the name of an embedded layout template or the path to an external (.ascx) template."
So it sounds like it should do what I expect, but when I drop the new control (which uses the same type as the original Navigation control) onto a page, it doesn't adopt the custom layout.
Why would that be?
Regards,
Jacques
Hello Jacques,
Thank you for contacting us.
If you'd like to use your navigation template as a separate navigation control, you would have to add a SiteMapDataSource to it and then register it Administration > Settings > Advanced > Toolboxes > Page Controls > Sections > NavigationControlsSection. and in Control CLR Type or Virtual Path specify the relative path to your custom navigation. Please take a look at the sample below to see hot to configure the SiteMapDataSource. In order for your navigation to display Sitefinity pages, you need to use SitefinitySiteMapDataSource:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomNavigationControl.ascx.cs" Inherits="SitefinityWebApp.CustomNavigationControl" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.NavigationControls" TagPrefix="navcontrols" %>
<
navcontrols:SitefinitySiteMapDataSource
ID
=
"SiteMapDataSource"
runat
=
"server"
ShowStartingNode
=
"false"
/>
<
telerik:RadMenu
runat
=
"server"
ID
=
"MyMenu"
DataSourceID
=
"SiteMapDataSource"
></
telerik:RadMenu
>