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, ...Including custom headers in skin and overriding body tag IDIncluding custom headers in skin and overriding body tag ID
Previous
 
Next
New Post
4/14/2011 3:25 PM
 
Hello:

This thread is a two-part question, though related to the parsing of skins.  I am familiar with both the use of HTML and ACSX when managing skins, but I am not an expert by any means, so please excuse any ignorance on my part.  I generally modify the default skin that comes with DNN to suit my purposes fine, and I am now having trouble getting some custom JS/CSS in the head of the template as well as a custom ID attribute for the body tag.  I duplicated the MinimalExtropy skin and made changes to build the following site:

http://www.on-ramptotheweb.org

We are now requiring advanced styling & JQuery UI.  We chose to use Fancybox and we placed the necessary files in the root of the site, where we would link to them in the HEAD section.  I expected to handle JS inclusion through the inclusion of a single file in the skin package, which would then include additional files, thus preventing the need to edit the skin file and re-parse (only the one .js file would be uploaded).  However, everything I have done to try to get css or js files included in the skin package have been in vain.  I attempted to update the HTML file for the selected skin (1280).  I modified the file "index 1280.html" to include the following:

<script src="js/onramp.js" type="text/javascript"></script>

This makes the HEAD section as follows:
<head>
    <link rel="stylesheet" type="text/css" href="skin.css" />
    <script src="js/onramp.js" type="text/javascript"></script>
    <title></title>
</head>

I would think that when I upload the .html file to the site and parse the skin package, then view a page, this JS file would be included.  However, it never is.  The above code is currently in the 1280 skin, which is the default skin file in use for the site referenced above.  When you view the homepage, or any page using this skin, the onramp.js is never found in the source.  The onramp.js file itself has an alert call, so it should popup an alert box if executing.  When I parse the skin package, I see the following which shows that it finds the onramp.js directive and makes the substitution:

(I can provide the full output if necessary, it's quite long)
# Begin processing file: index 1280.html
(some lines removed)
# Substituting: <script src="js/onramp.js" type="text/javascript">
With: <script src="/portals/_default/skins/onramp/js/onramp.js" type="text/javascript">
# Substituting: <link rel="stylesheet" type="text/css" href="skin.css" />
With: <link rel="stylesheet" type="text/css" href="/portals/_default/skins/onramp/skin.css" />
# Formatting control directive: <%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="LINKS" Src="~/Admin/Skins/Links.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
# Formatting registration directive: <%@ Register TagPrefix="dnn" TagName="STYLES" Src="~/Admin/Skins/Styles.ascx" %>
# Writing file: index 1280.ascx
End processing file: index 1280.html

So, am I missing a step here that should cause the .js to be included?  The same happens with custom CSS, nothing I add to the HEAD section remains after the skin package is parsed.  The skin.css that was already in the file from MinimalExtropy does get carried over, so I'm not sure why additional CSS that I add or JS is lost in parsing.  The only way we got FancyBox to work is to include the FancyBox files in each page using the Page Settings screen.  This is not ideal and now that we are looking at hundreds of pages needing the functionality, we need to do something different.

The second issue I have is overriding the ID attribute of the body tag (or maybe just including tag-specific styling).  By default the <body> tag of the HTML file becomes <body id="Body"> when parsed or compiled, I'm not sure of the terminology.  We have a secondary skin file (in the same skin package) that is blank, so just a blank template.  We use this for the modal popups from FancyBox.  We want the same font styles, etc, but the main skin file (index 1280) uses background images for the body.  We do not want to separate our CSS files (i.e., one for 1280 and one for blank) so that font styles are consistent, we just want to avoid the background image for the blank skin file which we do not want included in the blank template.  The simplest solution is to have something other than "Body" for the id attribute of the body tag.  However, when we put in <body id="BodyBlank"> this is not carried over (final output always has <body id="Body"> ).  If we changed the styling information for body#Body, then the main skin file would not be correct (lose the background images).  As such, we need a way to separate out the body attributes for the blank skin file so that styling can be applied as needed while maintaining the inclusion of common styling elements such as font size/color/face/etc.  We've also tried <body style="background-image: none;"> but the style attribute also does not carry over after the skin package is parsed.

What is the best way to control the tags, such as body, that are not available in the ASCX file when multiple skin files are in use on a site and using a common stylesheet?

Thanks in advance for any assistance you can offer.
 
New Post
4/14/2011 5:54 PM
 
If DNN parses the skin it only keeps what's inside the body tag of the HTML document, the rest is not used.
So whatever you add to the head of the HTML skin does not end up in the ASCX file (which is the actual skin)
It does by default load some CSS files, which are the ones you should add your CSS to (Read More)

JS can be added inside the body tag or you can use our Style Helper skin object: http://bit.ly/hLSd15
It was created to allow you to add JS (and CSS) to the head of the page and it also supports changing the body tags class without "hacking the core".
(and much more...)

HTH.
 
New Post
5/26/2011 4:23 PM
 
Timo Breumelhof wrote:
If DNN parses the skin it only keeps what's inside the body tag of the HTML document, the rest is not used.
So whatever you add to the head of the HTML skin does not end up in the ASCX file (which is the actual skin)
It does by default load some CSS files, which are the ones you should add your CSS to (Read More)

JS can be added inside the body tag or you can use our Style Helper skin object: http://bit.ly/hLSd15
It was created to allow you to add JS (and CSS) to the head of the page and it also supports changing the body tags class without "hacking the core".
(and much more...)

HTH.

 Those worked great for me, thanks.

 
New Post
5/27/2011 2:19 AM
 
Good to hear!
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Including custom headers in skin and overriding body tag IDIncluding custom headers in skin and overriding body tag ID


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