Reputation: 1579
In DotNetNuke(DNN) am trying to create a page template that will be used to create HTML for emails. Because the HTML is going to be used in emails, it needs to be strictly controlled. The user will create the page in DNN, then copy the HTML for the page and use it in MailChimp. I don't want anything extra in the HTML, it should be as minimized as possible.
The template will have placeholders for header body and footer. The user can put different modules into these areas depending on what they want to do with the email.
To accomplish this I created a Skin. It appears to me to be about as simple as it gets. Here is the skin file:
<%@ Control Language="C#" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<div id="HeaderPane" runat="server"></div>
<div id="ContentPane" runat="server"></div>
<div id="FooterPane" runat="server"></div>
Although the skin looks as simple as it gets, the output is nowhere near the level of simplicity that I require. To test, I have created a new page and selected this skin. Before adding anything to the page, I load it into a web browser. The page of course appears blank, but when I view the HTML I see the following source:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en-US">
<head id="Head">
<!--**********************************************************************************-->
<!-- DotNetNuke - http://www.dotnetnuke.com -->
<!-- Copyright (c) 2002-2013 -->
<!-- by DotNetNuke Corporation -->
<!--**********************************************************************************-->
<title>
PAGE TITLE HERE
</title><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><meta content="text/javascript" http-equiv="Content-Script-Type" /><meta content="text/css" http-equiv="Content-Style-Type" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta id="MetaKeywords" name="KEYWORDS" content=",DotNetNuke,DNN" /><meta id="MetaCopyright" name="COPYRIGHT" content="Copyright © 2014 XXXX. All rights reserved.<br/>MY ADDRESS HERE" /><meta id="MetaGenerator" name="GENERATOR" content="DotNetNuke " /><meta id="MetaAuthor" name="AUTHOR" content="XXXXXXX" /><meta name="RESOURCE-TYPE" content="DOCUMENT" /><meta name="DISTRIBUTION" content="GLOBAL" /><meta id="MetaRobots" name="ROBOTS" content="INDEX, FOLLOW" /><meta name="REVISIT-AFTER" content="1 DAYS" /><meta name="RATING" content="GENERAL" /><meta http-equiv="PAGE-ENTER" content="RevealTrans(Duration=0,Transition=1)" /><style id="StylePlaceholder" type="text/css"></style><link href="/portals/_default/default.css?cdv=80" type="text/css" rel="stylesheet"/><link href="/portals/0/portal.css?cdv=80" type="text/css" rel="stylesheet"/><script src="/resources/shared/scripts/jquery/jquery.min.js?cdv=80" type="text/javascript"></script><script src="/resources/shared/scripts/jquery/jquery-migrate.min.js?cdv=80" type="text/javascript"></script><script src="/resources/shared/scripts/jquery/jquery-ui.min.js?cdv=80" type="text/javascript"></script>
<link rel='SHORTCUT ICON' href='/Portals/0/favicon.ico' type='image/x-icon' />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'ACCOUNT_NUMBER']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body id="Body">
<form method="post" action="/PATH/TO/CURRENT_FILE/Demo2.aspx" id="Form" enctype="multipart/form-data">
<div class="aspNetHidden">
<input type="hidden" name="StylesheetManager_TSSM" id="StylesheetManager_TSSM" value="" />
<input type="hidden" name="ScriptManager_TSM" id="ScriptManager_TSM" value="" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="LONG VIEWSTATE ENCODED VALUE IS HERE" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['Form'];
if (!theForm) {
theForm = document.Form;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="/WebResource.axd?d=ENCODED_STRING&t=635195493660000000" type="text/javascript"></script>
<script src="/Telerik.Web.UI.WebResource.axd?LONG_QS_VARIABLE=XXXXXXXXX" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>
<script src="/js/dnn.js" type="text/javascript"></script>
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="LONG ENCODED VALUE" />
</div><script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager', 'Form', [], [], [], 90, '');
//]]>
</script>
<script src="/js/debug/dnn.modalpopup.js?cdv=80" type="text/javascript"></script><script src="/js/debug/dnn.servicesframework.js?cdv=80" type="text/javascript"></script><script src="/js/debug/dnncore.js?cdv=80" type="text/javascript"></script>
<div id="dnn_HeaderPane" class="DNNEmptyPane"></div>
<div id="dnn_ContentPane" class="DNNEmptyPane"></div>
<div id="dnn_FooterPane" class="DNNEmptyPane"></div>
<input name="ScrollTop" type="hidden" id="ScrollTop" />
<input name="__dnnVariable" type="hidden" id="__dnnVariable" autocomplete="off" value="`{`__scdoff`:`1`,`sf_siteRoot`:`/`,`sf_tabId`:`423`}" />
<script type="text/javascript" src="/Resources/Shared/scripts/initWidgets.js" ></script></form>
</body>
</html>
I am not using forms, I don't need any jQuery or Javascript functionality, all of the styles are going to be inline (or included in a <style>
tag and won't be external references). I just want the HTML structure without all of the other stuff surrounding it.
Is this possible in DNN?
Upvotes: 0
Views: 332
Reputation: 4855
As DNN is a WebForms based application, some things like the ViewState and the WebResource.axd links, etc. are going to be next to impossible to get rid of.
For other items, review what modules are being loaded on the page. Ensure that you don't have modules that are marked to "include on every page".
Upvotes: 1