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, ...Hack Management for CSS skins & IE7 problemsHack Management for CSS skins & IE7 problems
Previous
 
Next
New Post
1/20/2006 9:31 AM
 
Hello,

I'm currently experimenting with CSS layout skins. Within my skins I have had to use several hacks to get the layout that I need.

Upon further research I've discovered that the new IE7 browser will no longer be able to see these hacks, read this article for further info:
http://www.positioniseverything.net/articles/ie7-dehacker.html

The solution is to create a CC - Conditional Comment which only IE browsers can read which specifies to go to a separate .css file to read the hacks.

Great, the problem is how to get this comment into the code & how to link to this additional css file -  iehacks.css file

The comment code needs to be in the head section of the document, so you can add the comment:

<code>

<!--[if IE]>
<link rel="stylesheet" type="text/css"
href="iehacks.css" />
<![endif]-->

</code>

Problem 1) - How do you add this code?

by editing the default.aspx file - not ideal if you want to use a skin on different portals.

by adding the code for each page using the head tag feature on the page settings - not ideal because you have to do this for every page.

Problem 2) - Specifying the URL?
The second problem is that you need to specify the location where you have uploaded the iehacks.css file, so if this is enclosed within your skin zip file it could be located in various areas such as the default portal folder or the portal number folder eg.
"/DNN32TestInstallTemplate/Portals/_default/Skins/myskin/iehacks.css"

My concern here is that if you create a css layout skin for release which contains hacks for all IE browsers, how will you make it easy for people installing the skin to set the skin up? - I can find a solution for my own installs, but how can I easily share the skins that I have made with this specific setup?

Has anyone come across any solutions for this?

Any thoughts appreciated,

Lee Sykes - DNN Creative Magazine - 600+ Video Tutorials, Articles, Interviews - July Issue 58 out now!
DNN Creative Magazine for DotNetNuke

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
 
New Post
1/20/2006 10:25 AM
 

The solution is quite painless if you use Javascript in your skin to inject the IE-specific stylesheet directly into the document's styleSheets collection.

Nik

<script type="text/javascript">

if (document.createStyleSheet)
    document.createStyleSheet("<%= SkinPath %>/iehacks.css");

/*
(All of this commented code is not needed...just providing it here in case a hack is needed for another browser.)

else
{
 var styles = "@import url('<%= SkinPath %>/otherhacks.css');";
 var newStyleSheet=document.createElement("link");
 newStyleSheet.rel="stylesheet";
 newStyleSheet.href="data:text/css,"+escape(styles);
 document.getElementsByTagName("head")[0].appendChild(newStyleSheet);
}
*/

</script>


Nik Kalyani
Co-founder
DotNetNuke Corporation
Blog | Twitter | FaceBook
 
New Post
1/20/2006 10:33 AM
 
Hi Nik

Thanks for responding. - Using Javascript in this way, will this send just IE browsers to the stylesheet?

I would have thought all browsers would call up this stylesheet when you use Javascript? - The reason for using the CC version for calling up the stylesheet is so that only IE browsers visit the stylesheet because IE will no longer respond to the current hacks, so in the hack style sheet it will just read as straight css without all the hacks surrounding the code.

Does this make sense?

The other question is how do you get your users to add this Javascript to their installations? I'm trying to find a way to make the skin easy to install as well with this modification.

Thanks for your help,

Lee Sykes - DNN Creative Magazine - 600+ Video Tutorials, Articles, Interviews - July Issue 58 out now!
DNN Creative Magazine for DotNetNuke

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
 
New Post
1/20/2006 10:46 AM
 

dnncreative wrote
Using Javascript in this way, will this send just IE browsers to the stylesheet?


Yes.

dnncreative wrote
The other question is how do you get your users to add this Javascript to their installations? I'm trying to find a way to make the skin easy to install as well with this modification.

As I said, just add the code to your skin. No different than adding any other HTML. Just type <script> ... code ...</script> and you're done.

Nik


Nik Kalyani
Co-founder
DotNetNuke Corporation
Blog | Twitter | FaceBook
 
New Post
1/20/2006 10:50 AM
 
aah right, ok, thanks, Nik

Lee Sykes - DNN Creative Magazine - 600+ Video Tutorials, Articles, Interviews - July Issue 58 out now!
DNN Creative Magazine for DotNetNuke

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Hack Management for CSS skins & IE7 problemsHack Management for CSS skins & IE7 problems


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