在 DotNetNuke(DNN) 中,我试图创建一个页面模板,用于为电子邮件创建 HTML。因为 HTML 将在电子邮件中使用,所以需要严格控制。用户将在 DNN 中创建页面,然后复制页面的 HTML 并在 MailChimp 中使用它。我不希望 HTML 中有任何额外内容,它应该尽可能地最小化。
该模板将包含页眉正文和页脚的占位符。用户可以根据他们想要对电子邮件执行的操作将不同的模块放入这些区域。
为此,我创建了一个皮肤。在我看来,这很简单。这是皮肤文件:
<%@ 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>
尽管皮肤看起来很简单,但输出远不及我需要的简单程度。为了测试,我创建了一个新页面并选择了这个皮肤。在向页面添加任何内容之前,我将其加载到 Web 浏览器中。该页面当然显示为空白,但是当我查看 HTML 时,我看到以下来源:
<!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>
我没有使用表单,我不需要任何 jQuery 或 Javascript 功能,所有样式都将是内联的(或包含在<style>
标签中并且不会是外部引用)。我只想要 HTML 结构,没有围绕它的所有其他内容。
这在 DNN 中可能吗?