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, ...How to set the doctype for all skin layouts at once?How to set the doctype for all skin layouts at once?
Previous
 
Next
New Post
10/6/2014 11:01 AM
 

I'll admit straight up that I've also asked this on Stack Overflow. Here's the deal:

I'm trying to set the doctype for my Skin to the html5 <!doctype html> doctype. However, I want to prevent the need to have to remember to do this for each variant I create. That is, my current structure was:

_default\Skins\MySkin\TwoColumnLayout.ascx
_default\Skins\MySkin\TwoColumnLayout.doctype.ascx

With the latter containing the contents:

<SkinDocType><![CDATA[<!DOCTYPE html>]]></SkinDocType>

Now I want to create more ascx layouts, without having to remember to create a doctype file. So I followed DNN instructions I found here and here, creating this structure:

_default\Skins\MySkin\TwoColumnLayout.ascx
_default\Skins\MySkin\ThreeColumnLayout.ascx
_default\Skins\MySkin\Default.doctype.ascx (A)
_default\Skins\MySkin\MySkin.doctype.ascx (B)
_default\Skins\MySkin\MySkindoctype.ascx (C)

But none of them worked. I had (A) there as my gut-feeling attempt, option (B) from my first time reading the first bit of linked documentation, and (C) from the second time reading the documentation. However, none of them worked...

Of course I can repeat the doctype file for each view, but I'm bound to forget that one day. Is there a way to set the doctype once for all views in my skin?

 
New Post
10/6/2014 6:37 PM
 

You have to create an XML file for each ascx control e.g.  ...\TwoColumnLayout.doctype.xml with this code insert:


Please check out the sourcecode on aarsysmetro7skin.codeplex.com for the Content of the xxx.doctipye.xml

 
New Post
10/7/2014 2:44 AM
 

Thank you for taking the time to answer.

What you're suggesting is exactly what I'm doing currently. My question was about how to avoid having to create a doctype file for each layout. Or was your suggestion meant as confirmation that it's impossible to do set the doctype only once for all layouts at the skin level?

In the mean time, let me also share the workaround that was offered on Stack Overflow by user Joe Craig:

> You can set a "fallback" doctype which will be used if none is specified. you can find this setting at:

> Host Settings > Basic Settings tab > Appearance section > "Fallback Skin Doctype" (the last setting)

As all my portals use the same skin I ended up using that workaround.

 
New Post
10/7/2014 3:31 AM
 

There are 2 alternatives.

1. You can set the fallback doctype for your DNN install under Host  > Host Settings > Basic Settings > Host Details > Fallback Skin Doctype
Should default to HTML 5 for new installs. But obviously not very portable and a risk when there are multiple portals.

 2. You can also download & Install our https://stylehelper.codeplex.com/

And add this to your skin.ascx files:

<%@ Register TagPrefix="fortyfingers" TagName="STYLEHELPER" Src="~/DesktopModules/40Fingers/SkinObjects/StyleHelper/StyleHelper.ascx" %> <fortyfingers:STYLEHELPER id="FFSH1" doctype="html 5" runat="server" />

 This sets the doctype from the ascx file (which is what I prefer)

 
New Post
10/7/2014 7:34 AM
Accepted Answer 

Thanks Timo for also taking some time to answer.

The first solution is the same workaround mentioned on Stack Overflow, and I'll be using that as all my portals will have the same skin.

The Stylehelper you mention/created does seem like a nice helpful tool. For the doctype issue it will not solve my problem though: I'd still have to set the doctype for every ascx.

In conclusion, it seems the answer is that:

  • Set the doctype host-wide: possible, via abovementioned setting.
  • Set the doctype skin-wide: impossible.
  • Set the doctype per ascx: possible with a .doctype.xml file or the Stylehelper.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...How to set the doctype for all skin layouts at once?How to set the doctype for all skin layouts at once?


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