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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRole-based skinning?Role-based skinning?
Previous
 
Next
New Post
4/7/2010 8:34 AM
 

Hello,

for an intranet project on DNN 5 I need to change the skin depending on users' roles: DNN only allows to set skin and container on a per-page basis, and afaik there's nothing to do what I need.

Would it be possible to achieve this without modifying the core, and without passing querystring variables on every page? I know I can pass something like SkinSrc=PATH_TO_SKIN in order to force a skin, but would like to hide this to users. Is that possible?
Any help greatly appreciated, thank you.

Regards,

al.

 

 
New Post
4/12/2010 10:45 AM
 

I have seen this done before using an ascx skin that had server side code in it to swap sections in and out depending on the users role.

It is NOT an elegant solution, but it did work.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
4/12/2010 11:01 AM
 

 Mitchell,

thanks for your answer: I actually hoped in a more elegant solution, but did not find anything yet.

The only other solution I found is this module at Snowcovered, which unfortunately is no good for DNN 5. If anybody knows of a different solution please tell me (I just don't want to modify the core).

 
New Post
4/14/2010 4:24 PM
 

Hi Alberto,

I have a similiar situation and found a solution.  In the page_init of Default.aspx you can insert code like what is below:

            Dim ctlSkin As DotNetNuke.UI.Skins.Skin
            Dim lSkin As String
            Dim lDefaultSkin As DotNetNuke.UI.Skins.Skin

            If ( Condition 1 ) Then
                lDefaultSkin = DotNetNuke.UI.Skins.Skin.GetSkin(Me)
                lSkin = Replace(lDefaultSkin.SkinSrc, " default skin ", " condition 1 skin ")
                ctlSkin = LoadSkin(Me, lSkin)
            ElseIf ( Condition 2 ) Then
                lDefaultSkin = DotNetNuke.UI.Skins.Skin.GetSkin(Me)
                lSkin = Replace(lDefaultSkin.SkinSrc, " default skin ", " condition 2 skin ")
                ctlSkin = LoadSkin(Me, lSkin)
            Else
                ctlSkin = DotNetNuke.UI.Skins.Skin.GetSkin(Me)
            End If

You will also need the function LoadSkin().  ctlSkin will already be initialized so you'll want to take that out, or leave it in.  Let me know how this works for you and/or if you need help getting the LoadSkin() function.

 
New Post
4/16/2010 5:47 AM
 

 Paul,

thank you so much for your suggestions: I will sure try this approach as soon as the project starts.

The only thing I don't like is that modifying the core involves re-installing the modification when I'll upgrade DNN - but this looks like it's the cleaner approach to the problem I found 'til now.

As for the LoadSkin function I will try myself, and eventually ask again for your help :)

Best regards,

al.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRole-based skinning?Role-based skinning?


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