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, ...Problem with Skinning and PanesProblem with Skinning and Panes
Previous
 
Next
New Post
3/11/2007 3:19 AM
 

Hi,

I created my own skin for the web site. It has a different background color for registered and non-registered users. To do that, I places some code in the Page_Load handler of the skin control, the code is below.

However, if I define the top table (or div) as a server control so that I can change it's color, then after login into the site as admin, DNN cannot find the panes and the Add modules menu is incorrect.

I tried to debug this and saw that the code is simply doing FindControl at the top level of the skin. So when I add athe enclosing server side control, FindControl can't find the internal pane control.

This is very annoyoing and I wasn't able to find a solution for this prolem.

Again, I am trying to have a different look for my site for registered users and non-registered users (background color).

Any idea (except changing the code DNN code)???

Here is the code I am using:

 

<

Private

 

dnnSOLPARTMENU.Visible =

trMenu.Visible =

trTop.Visible =

 

 

dnnSOLPARTMENU.Visible =

trMenu.Visible =

trTop.Visible =

 

End

</

<

<

...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...

</

</

 

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

table>div>
<tr ><td valign="top" ><table cellspacing="0" cellpadding="0" width="100%" border="0"> <tr> <td class="toppane" colspan="2" id="TopPane" runat="server" valign="top" align="center" ></td> </tr><tr valign="top"><td class="leftpane" id="LeftPane" runat="server" valign="top" align="center"></td><td class="contentpane" id="ContentPane" runat="server" valign="top" align="center"></td></tr><tr><td class="bottompane" colspan="2" id="BottomPane" runat="server" valign="top" align="center"></td></tr></table></td> </tr>
script runat="server"> Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadIf DotNetNuke.Security.PortalSecurity.IsInRole(PortalSettings.RegisteredRoleName()) ThenTrueTrueTrue divSite.Style.Add("background-color", "#DDDDDD")ElseFalseFalseFalse

"background-color", "#A1CFEB")End If Subscript>div runat=server id='divSite' >table width="100%" border="0" style="margin:0px" cellspacing="0" cellpadding="0" id="tblSite" >

divSite.Style.Add(
 
New Post
3/12/2007 7:58 PM
 
Maybe this post might help
 
New Post
3/13/2007 4:24 AM
 

Thanks for the link. It looks interesting but my case is for logged in users vs. guests.

So how would I define the classes in this case?

Many thanks!

Ofer

 

 
New Post
3/13/2007 6:35 AM
 
Check the "related blog" link at the bottom of the post.
That one shows you how to do what you want I think.
I would use it like this:

Put this in the script part of the skin:

Public Function IsAdmin() as string
    If DotNetNuke.Security.PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) then
      return " AdminMode"
    Else
       return ""
    End If
End Function

In the skin:

<div class="maindiv<%=IsAdmin%>">
    all the rest of your skin

</div>

This should give the div a class "maindiv" if not logged in and a class "maindiv AdminMode" if logged in.
 
New Post
3/13/2007 6:43 AM
 

I am already using a similar code (the code I posted didn't come out right for some reason).

My problem is different, it is related to the way DNN parses the panes.

Currently I am using client side Javascript to change the background color. Not ideal but works.

Thanks anyway.

Ofer

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Problem with Skinning and PanesProblem with Skinning and Panes


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