Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Using Links Skin ObjectUsing Links Skin Object
Previous
 
Next
New Post
3/28/2007 12:30 PM
 

It's a bit of a hack Salar, but if you want a copy it's easy enough to make.  Just clone the Links.ascx and the Links.ascx.vb files and rename them to something you like.  Then modify Links.ascx.vb so it requires both hidden and disabled to be checked.  Create an XML file for uploading, zip it and you have one really flexible use skin object.

Or, let me have your email and I'll send you the prepackaged zip.  Only difference in mine is I was lazy and simply put an "m" in front of Links.  So it's an mLinks object but still responds to MLINKS in the skin objects area and in usage once installed.

I manually uploaded mine then set the object path to use Admin/Skins.  If you upload you would (obvoiusly) have to use the DesktopModules/mLlinks (or MLINKS) path. 

If you want it, just let me know.

Clay

 
New Post
3/28/2007 2:02 PM
 

Many thanks Clay

The method looks good to suggest as an enhancement in bug tracker.

Or may be could be packaged as a free Skin Object for the community. Two menu options are very useful in a site with large number of pages. It reduces the large overhead that SolpartMenu creates. We just changed a customer site from solpart as the page source was 340k + the first load overhead it was over 500k page size. so as soon as we changed it to a two menu method, the page size was reduced to just 150k. I could try it this weekend as I am trying couple of new menus as well. (Salar    (at)    salaro  (dot)  net).

Salar

 
New Post
3/28/2007 7:10 PM
 

Hi Salar,

I tried to send to the email you put in and it bounced back.  So, I left a message in the Feedback module on your site so you will have my address to send a mail to.  Then I will reply with the attachment for you.  If that fails, I'll post the modification code here.

God bless,
Clay

 
New Post
4/4/2007 7:14 PM
 

Hi Clay,

Any hope of releasing this to the community as a free skin object?  It would be nice to have some added flexibility to use when building out your site navigation.

Thanks,

Paul

 
New Post
4/4/2007 10:10 PM
 

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

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Using Links Skin ObjectUsing Links Skin Object


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out