I'd be happy to give back a little bit. I have received so much from DNN. So, here is the code for the .ascx.vb file. It uses the same code in the .ascx file as the normal Links Skin Object, but obvoisly is modified to point to the "new" mLinks Skin Object ascx.vb file.
I am not sure how to paste xml code in here so you need to clone an xml file from another skin object to use if you intend to upload via the module upload function. Alternatively you can FTP it up as well.
When that is all finished, make sure the "new" skin object exists in the skin objects area linked to at the top of the Module Definitions list in the Admin men
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Controls.Links" CodeFile="mLinks.ascx.vb" %>
Here is the code for the .ascx.vb file (and I encourage you to leave the DNN copyright in it when used as it is basically a cloned file with one change):
'
' DotNetNuke® - http://www.dotnetnuke.com
' Copyright (c) 2002-2006
' by Perpetual Motion Interactive Systems Inc. ( http://www.perpetualmotion.ca )
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
Imports DotNetNuke.Entities.Tabs
Namespace DotNetNuke.UI.Skins.Controls
''' -----------------------------------------------------------------------------
'''
'''
'''
'''
''' [cniknet] 10/15/2004 Replaced public members with properties and removed
''' brackets from property names
'''
''' -----------------------------------------------------------------------------
Partial Class Links
Inherits UI.Skins.SkinObjectBase
' private members
Private _separator As String
Private _cssClass As String
Private _level As String
Private _alignment As String
' protected controls
#Region "Public Members"
Public Property Separator() As String
Get
Return _separator
End Get
Set(ByVal Value As String)
_separator = Value
End Set
End Property
Public Property CssClass() As String
Get
Return _cssClass
End Get
Set(ByVal Value As String)
_cssClass = Value
End Set
End Property
Public Property Level() As String
Get
Return _level
End Get
Set(ByVal Value As String)
_level = Value
End Set
End Property
Public Property Alignment() As String
Get
Return _alignment
End Get
Set(ByVal Value As String)
_alignment = Value
End Set
End Property
#End Region
#Region " Web Form Designer Generated Code "
Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
'*******************************************************
'
' The Page_Load server event handler on this page is used
' to populate the role information for the page
'
'*******************************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' public attributes
Dim strCssClass As String
If CssClass <> "" Then
strCssClass = CssClass
Else
strCssClass = "mLinks"
End If
Dim strSeparator As String
If Separator <> "" Then
If Separator.IndexOf("src=") <> -1 Then
strSeparator = Replace(Separator, "src=", "src=" & PortalSettings.ActiveTab.SkinPath)
Else
strSeparator = "" & Replace(Separator, " ", " ") & ""
End If
Else
strSeparator = " "
End If
' build links
Dim strLinks As String = ""
strLinks = BuildLinks(Level, Alignment, strSeparator, strCssClass)
If strLinks = "" Then
strLinks = BuildLinks("", Alignment, strSeparator, strCssClass)
End If
lblmLinks.Text = strLinks
End Sub
Private Function BuildLinks(ByVal Level As String, ByVal Alignment As String, ByVal strSeparator As String, ByVal strCssClass As String) As String
Dim strLinks As String = ""
Dim strLoop As String
Dim intIndex As Integer
For intIndex = 0 To PortalSettings.DesktopTabs.Count - 1
Dim objTab As TabInfo = CType(PortalSettings.DesktopTabs(intIndex), TabInfo)
If objTab.IsVisible = False AND objTab.DisableLink = True And objTab.IsDeleted = False Then
If (objTab.StartDate < Now And objTab.EndDate > Now) Or AdminMode = True Then
If PortalSecurity.IsInRoles(objTab.AuthorizedRoles) = True Then
strLoop = ""
If Alignment = "Vertical" Then
If strLinks <> "" Then
strLoop = "
" & strSeparator
Else
strLoop = strSeparator
End If
Else
If strLinks <> "" Then
strLoop = strSeparator
End If
End If
Select Case Level
Case "Same", ""
If objTab.ParentId = PortalSettings.ActiveTab.ParentId Then
strLinks += strLoop & AddLink(objTab.TabName, objTab.FullUrl, strCssClass)
End If
Case "Child"
If objTab.ParentId = PortalSettings.ActiveTab.TabID Then
strLinks += strLoop & AddLink(objTab.TabName, objTab.FullUrl, strCssClass)
End If
Case "Parent"
If objTab.TabID = PortalSettings.ActiveTab.ParentId Then
strLinks += strLoop & AddLink(objTab.TabName, objTab.FullUrl, strCssClass)
End If
Case "Root"
If objTab.Level = 0 Then
strLinks += strLoop & AddLink(objTab.TabName, objTab.FullUrl, strCssClass)
End If
End Select
End If
End If
End If
Next intIndex
Return strLinks
End Function
Private Function AddLink(ByVal strTabName As String, ByVal strURL As String, ByVal strCssClass As String) As String
Return "" & strTabName & ""
End Function
End Class
End Namespace
When using it, just clone the normal control language from another DNN Skin Object such as the normal Links Object and modify it to aim at the "new" menu/links Object. It supports exactly the same properties as the Links Skin Object, i.e. it can be set to vertical, horizontal, and the menu "level" can be set to "Same" or "Root" or "Child" etc. You can find all that in the skinning document for DNN.
Hope it helps,
Clay