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, ...Urgent: solution needed to Use custom skin in module developmentUrgent: solution needed to Use custom skin in module development
Previous
 
Next
New Post
12/2/2009 11:15 AM
 

I am really stuck with this problem these days, anyone has good solution.

Problem: one module has serveral controls, use custom skin for the "main" view, use editURL  to go to other controls, then the skin will change to admin/default skin, always.

cause:

=====================

The reason users don't see additional modules in the edit text screen is because DotNetNuke checks the URL for a parameter "ctl". If DotNetNuke sees the parameter "ctl" in the URL, it will do two things: Load only the module that has it's module ID in the URL (represented by mid in the URL), and the other is loading the module in the assigned Admin Skin set in Site Settings under the Appearance section. While this is fine for the Text/HTML module, this can cause confusion in some modules where the page assigned skin may be drastically different from the assigned Admin Skin for the site.

========================

From: www.apptheory.com/dotnetnuke/dotnetnuke_blogs/ctl/articleview/mid/1002/articleid/141/avoiding_the_dotnetnuke_admin_skin.aspx

Solutions I got and tried:

1. change admin skin, this is not good because we have several modules with different custom skin

2. use  skinSrc and ContrainerSrc, this solvers the problem temporily, but when the page has a postback, e.g., click one button to show something, the page refreshed and the admin/default skin appeared AGAIN!

also, for every editURL, we have to add the querystring (?skinSrc=...), very annoying...

3. the method where the efficon article module used, seems to be good, but when view a news article in "another page", admin skin is used too, so this is not the best

4. the guy in AppTheory suggested:

http://www.apptheory.com/dotnetnuke/dotnetnuke_blogs/ctl/articleview/mid/1002/articleid/141/avoiding_the_dotnetnuke_admin_skin.aspx

========================

To avoid this, module developers need to create a way to dynamically load the control themselves instead of relying on the DotNetNuke framework. To accomplish this, developers should set the initial "View" control to a dispatch page that determines which interface to load based on what parameters are in the URL. At AppTheory, we often use the parameter "mctl" and then have our 'dispatch' page check for this parameter in the URL. If the parameter doesn't exist, we simply dynamically load the control that would have been set as the initial view control for the module. If the parameter does exist, we check the value for "mctl" and load whatever interface we have that corresponds to the mctl parameter in the URL....

=============================

seems to be perfect, but are there any sample code or hints?

5.maybe the best solution:

in the control page_load or page_init, portalsettings.activetab.skinSRc to set the skin, but testing not good. seems that the DNN framework (default.aspx) takes the control..

ANY SUGGESTIONS?

 

 

 

 

 

 

 
New Post
12/2/2009 2:17 PM
 

Sub

 

Hi Steve -

 

This has always been an issue for me as well when developing dnn modules. There are 2 ways I have found to get around the issue one of them i think is similar to option#4

Is goes like this...

1. You create a control as a landing page that loads other controls. I call mine landingzone.ascx

2. I then register it as a view in the modules as you would normally

3. I use a "Hello World" and make sure it loads in the desired pane properly

4. Then remove the text and add a placeholder <asp:PlaceHolder ID="plControls" runat="server"></asp:PlaceHolder>  

 

 

 

5. Then on page load add a look for the querystring e.g  "mctrl" 

6. I will cut and paste the code

Private

 

m_controlToLoad As

String

 

Private

 

Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase

.Init

 

 

 

Try

 

ReadQueryString()

LoadControlType()

 

 

Catch exc As Exception

'Module failed to load

 

ProcessModuleLoadException(

 

Me

, exc)

 

 

 

End

Try

 

 

 

End

Sub

--------------------------------------------------------------------------------------------------

 

 

Private Sub

ReadQueryString()

 

 

 

If Not (Request("mctrl") Is Nothing)

Then

 

 

 

' Load the appropriate Control

 

 

 

'

 

 

 

Select Case Request("mctrl"

).ToLower()

 

 

 

Case "view"

'view products

 

m_controlToLoad =

 

"ucControl1.ascx"

 

 

 

Case "add"

'new product

 

m_controlToLoad =

 

"ucControl2t.ascx"

 

 

 

End

Select

 

 

 

Else

 

m_controlToLoad =

 

"ucControl.ascx"

 

 

 

End

If

 

 

 

End

Sub

 

 

 

Private Sub

LoadControlType()

 

 

 

If (m_controlToLoad <> "")

Then

 

 

 

Dim objPortalModuleBase As PortalModuleBase = CType(Me

.LoadControl(m_controlToLoad), PortalModuleBase)

 

 

 

If Not (objPortalModuleBase Is Nothing)

Then

 

objPortalModuleBase.ModuleConfiguration =

 

Me

.ModuleConfiguration

 

objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(m_controlToLoad)

plControls.Controls.Add(objPortalModuleBase)

 

 

End

If

 

 

 

End

If

 

 

 

End

-------------------------------------------------------------------------------------------------------------------

 

 
New Post
12/3/2009 9:10 AM
 

thanks.

I reformat your code


    Private m_controlToLoad As String
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init()
        Try
            ReadQueryString()
            LoadControlType()
        Catch exc As Exception
            'Module failed to load
            ProcessModuleLoadException(Me().exc)
        End Try
End Sub()

    Private Sub ReadQueryString()
        If Not (Request("mctrl") Is Nothing) Then
            ' Load the appropriate Control
            Select Case Request("mctrl").ToLower()
                Case "view"
                    'view products
                    m_controlToLoad = "ucControl1.ascx"
                Case "add"
                    'new product
                    m_controlToLoad = "ucControl2t.ascx"
            End Select
        Else
            m_controlToLoad = "ucControl.ascx"
        End If
    End Sub

    Private Sub LoadControlType()
        If (m_controlToLoad <> "") Then
            Dim objPortalModuleBase As PortalModuleBase = CType(Me.LoadControl(m_controlToLoad), PortalModuleBase)
            If Not (objPortalModuleBase Is Nothing) Then
                objPortalModuleBase.ModuleConfiguration = Me().ModuleConfiguration()
                objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(m_controlToLoad)
                plControls.Controls.Add(objPortalModuleBase)
            End If
        End If
    End Sub

 
New Post
12/14/2009 5:32 AM
 

Hi all,

I have the very some problem with a module that I don't own the source.

Does anyone knows a workarround tha I could use?

Isn't any fix for this in the DNN 5.x versions?

 

Thanks in advance

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Urgent: solution needed to Use custom skin in module developmentUrgent: solution needed to Use custom skin in module development


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