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, ...Dynamic Skin ProxyDynamic Skin Proxy
Previous
 
Next
New Post
3/13/2012 1:41 PM
 

I am trying to create a way to dynamically choose the skin based on the value of a QueryString Value. Based on a post I found I created a file called LayoutSelector.ascx which contains:

<%@ Control Language="VB" AutoEventWireup="false" Explicit="true" Inherits="DotNetNuke.UI.Skins.Skin" %>

<script runat="server">
    Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
          Dim layout = "/RumpusMain/RumpusMain.ascx"
          Dim CategoryID =  0
          If Request.QueryString("CategoryID") <> "" Then
                CategoryID = Request.QueryString("CategoryID")
                Select Case CategoryID
                     Case 32
                           layout = "/Rumpus-MountUnion/RumpusMain.ascx"
                End Select
           End If
           Controls.Add(LoadControl(TemplateSourceDirectory + layout))
      End Sub
</script>

This code works in that it loads the appropriate skin file. However I get the following error:

DotNetNuke.Services.Exceptions.PageLoadException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

After hours of unsuccessful google searches I found that if I removed Inherits="DotNetNuke.UI.Skins.Skin" from my skin file the error went away. Unfortunately non of the DotNetNuke Components will work. Does anyone have any suggestions on how to work around this.

 
New Post
3/13/2012 3:51 PM
 
Somebody has to know how to get around this?
 
New Post
3/13/2012 4:24 PM
 
What are you really trying to achieve?

It does not seem useful to load any random skin, so I am assuming that what you need to do is actually more constrained than that.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
3/13/2012 4:31 PM
 
I have a site that where College licensed seating is sold. The site has one default skin that is used for general pages. Each School page has a similar skin that is themed to match school colors and logos. The Store however uses one page for the product list and one page for product detail. Based on the QueryString Value of Category ID (From Which I can derive which school) I want to specify the Skin to be displayed.
 
New Post
3/13/2012 6:36 PM
 
Ok - so would it be sufficient to use a single skin, but allow that skin to call for School specific colors/logos?

That is pretty easy to do. You can either create skin objects, or just write code in the skin. It might allow you to, eventually, abandon the several similar skins in favor of just one.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Dynamic Skin ProxyDynamic Skin Proxy


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