DotNetNuke has supported navigation providers for about a year and a half. Currently there are 4 providers we support. The provider model is based off of interfaces, promoting a one-size-fits-all mentality. This can be both a blessing and a curse. The curse as it relates to the navigation providers is that it limits the features that the navigation provider's control can support. For example, recently I added support for the DNNMenu to support horizontal submenus. In order for this feature to be used in a skin (using the navigation provider), it needs a property exposed. Adding this property, would expose it to all providers, which of course makes little sense for something like a treeview. 4.5 will no have the ability to specify custom attributes to the navigation providers. This can be accomplished by adding the following to the skin's ascx file.
The following directive needs to be added at the top
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.Skins" Assembly="DotNetNuke" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.Skins" Assembly="DotNetNuke" %>
Then within your skin object you simply embed a CustomAttributes element, then specify one or more attributes.
<dnn:NAV ID="dnnNav" runat="server" ProviderName="DNNMenuNavigationProvider">
<CustomAttributes>
<dnn:CustomAttribute Name="SubMenuOrientation" Value="Horizontal"/>
</CustomAttributes>
</dnn:NAV>
If you interested in how the skin object was modified, keep reading.
This is accomplished by adding a Generics collection to the NavObjectBase (which is used by the Nav.ascx skin object).
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)> _
Public ReadOnly Property CustomAttributes() As Generic.List(Of CustomAttribute)
Get
Return m_objCustomAttributes
End Get
End Property
The provider will then be able to enumerate these custom attributes and apply them to the underlying control.
For Each objAttr As DotNetNuke.UI.Skins.CustomAttribute In Me.CustomAttributes
Select Case objAttr.Name.ToLower
Case "submenuorientation"
Me.Menu.SubMenuOrientation = DirectCast(System.Enum.Parse(Me.Menu.SubMenuOrientation.GetType, objAttr.Value), DotNetNuke.UI.WebControls.Orientation)
End Select
Next