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, ...Different Skin - Multiple EnvironmentDifferent Skin - Multiple Environment
Previous
 
Next
New Post
4/27/2010 3:07 PM
 

I understand your example.  My issue is when MO is promoted to Prod.  The entire project is moved to Production.  I want blue to show up in MO and then Red in Prod.

 
New Post
4/27/2010 3:12 PM
 

ok here is some inline code you can use in your .ascx skin ( or convert it to a skinobject )

Put the following code right above the first html part of your skin

 

you need to change the code for the hostnames of your various servers youw ant to use it on. But this just loads a differnt css based on the hostname

<script runat="server">
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

Dim strCSSFile As String = "localhost.css"

 

        Select Case Request.Url.Host.ToString
            Case "domain1.com"

strCSSFile = "domain1.css"
               
            Case "domain2.com"

 

strCSSFile = "domain1.css"
               
            Case Else
               
        End Select



            'Find the placeholder control
            Dim objCSS As Control = Page.FindControl("CSS")

            If Not objCSS Is Nothing Then
                'First see if we have already added the <LINK> control
                Dim objCtrl As Control = Page.Header.FindControl(ID)

                If objCtrl Is Nothing Then

                    Dim skinpath As String = String.Empty
                    skinpath = CType(Me.Parent, Skin).SkinPath
                    Dim objLink As New HtmlLink()
                    'objLink.ID = CreateValidID(Name)
                    objLink.Attributes("rel") = "stylesheet"
                    objLink.Attributes("type") = "text/css"
                    objLink.Href = skinpath + CSSPath + strCSSFile

                    AddStyleSheet(objCSS, -1, objLink)


                End If
            End If
    End Sub

        Protected Sub AddStyleSheet(ByVal cssRoot As Control, ByVal InsertAt As Integer, ByVal link As Object)

            cssRoot.Controls.AddAt(InsertAt, link)

        End Sub


</script>

 

 
New Post
4/27/2010 4:35 PM
 

I would use conditional CSS in your skin.css

Wrap my skin in a div like this:

<div class='<%=PortalSettings.PortalAlias.HTTPAlias.Replace("/", "").Replace(".", "")%>'>

And precede the CSS with the generated portaliasclass

.wwwmysitecom .header{background:.....}

.wwwyoursitecom .header{background:.....}

 

 
New Post
4/27/2010 5:17 PM
 
Both look like possible options. I am going to look at both. Timo, You think your option is the easier of the two to implement?
 
New Post
4/28/2010 1:29 AM
 

If you only need to override a few item background colors etc than I would go for timo's solution

If you need to change a lot, then I would go for mine since then you dont have to worry about making sure you override every default option

another option that include's timo's solution but would not need another div wrapper

 

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim MyBody As Control = Me.Page.FindControl("Body")
 Dim objMyBody = CType(MyBody, System.Web.UI.HtmlControls.HtmlGenericControl)

Dim BodyClass as string = PortalSettings.PortalAlias.HTTPAlias.Replace("/", "").Replace(".", "")

objMyBody.Attributes.Add("class", BodyClass)

End Sub

 

This just adds the class to the body tag and you don't need an extra wrapper div if you dont need it

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Different Skin - Multiple EnvironmentDifferent Skin - Multiple Environment


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