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, ...Workaround for  "DNNAligncenter" class annoyance on DNN 4.x?Workaround for "DNNAligncenter" class annoyance on DNN 4.x?
Previous
 
Next
New Post
8/31/2009 6:30 AM
 

This post is about a fairly well-known skinning annoyance on DNN 4.x (apparently it has been eliminated on DNN 5). There have been several posts about it and several workarounds suggested, however none seem to work completely. I am starting this thread in case someone can share a reliable workaround without side effects.

Problem:

Regardless of the the Alignment setting of a module, if the admin skin is loaded (e.g. when module showing an "edit" control") the module always gets center alignment. This is because DNN inject the class "DNNAligncenter" class to the container when Admin skin loaded. I have found it very hard to override and retain functionality.

The frequently quoted solution is to override the DNNAligncenter class in the skin.css file, e.g.

.DNNAlignCenter{
text-align:left
}

or go to the main container that wraps around the site and specify left-align:

#mainConatiner td {text-align: left;}

... however these prevents you from setting centered alignment on any module when you do want centering.

Does anyone have a solution that overrides the centering when the admin skin is loaded, but does allow module alignment to be set to centered for selected modules (and that does not involve recompiling the DNN core)?

Here are a sample of the many posts made about this issue in the community.

  1. DNNAligncenter - Make it Hot! ( Skinning ) - DotNetNuke

    You can overrule this by overruling the DNNAlignCenter class (only if you don't use the module align on the rest of the site, or only add it to the admin ...
    www.dotnetnuke.com/Community/Forums/tabid/.../Default.aspx
  2. Getting rid of DNNAligncenter - Configure It! ( How do I ...

    How can I make "DNNAligncenter" class disappear? Well, following is a comment somehow related to the above question. Some challenges facing future releases ...
    www.dotnetnuke.com/Community/Forums/.../Default.aspx 
  3. Set alignment on admin container (remove DNNAligncenter class ...

    Maybe somebody have a better explaination why DotNetNuke needs to add a class called "DNNAligncenter" everytime where we have a pane (in setting pages)? ...
    www.dotnetnuke.com/Community/Forums/.../Default.aspx 
  4. Stop DNN from forcing "DNNAligncenter" class??? - Make it Hot ...

    Re: Stop DNN from forcing "DNNAligncenter" class??? .DNNAligncenter {text-align:left;}. Also, Timo mentioned about this in his blog ...
    www.dotnetnuke.com/Community/Forums/tabid/.../Default.aspx

And here's my Gemini ticket about the issue:

DNNP-10566 Bug Minor Skinning

Stop adding "DNNAligncenter" class when Admin skin loaded

 
New Post
9/1/2009 1:18 PM
 

I guess you want to address skins used on the admin and host pages and the skins that are used by the controls like the "Terms" and the "Login" page.

For these the align should be fixed to left and for the rest not, right?

There are 3 solutions for this.

1. Upgrade to DNN 5 ;-)

2. Use an exact  copy of your skin with a forced test-align:left only as the Admin skin.

3. Use some conditional CSS, but you need some inline ASP.NET for that.

This is how I would do that

Wrap your skin in this div:

<div class="<%=IIf(Request.RawUrl.ToLower.Contains("/ctl/"), "AdminSkin", "NormalSkin") & " " & PortalSettings.ActiveTab.BreadCrumbs(0).TabName%>">

.....You skin.....

</div>

This will render:

A. Class "AdminSkin" for all pages that are not an Admin or Host page but do use the Admin skin (login, terms etc.)

B. The name of the root page

So with the following CSS you can cover all pages that use the Admin skin:

.AdminSkin .DNNAligncenter, .Admin .DNNAligncenter, .Host .DNNAligncenter{text-aling:left;}

.Admin for all admin pages, .Host for all Host pages and .AdminSkin for the rest

HTH

 

 
New Post
9/3/2009 9:58 AM
 

Laurence, did you try my suggestions?

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Workaround for  "DNNAligncenter" class annoyance on DNN 4.x?Workaround for "DNNAligncenter" class annoyance on DNN 4.x?


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