理想情况下,我希望能够处理在Dreamweaver中使用Mako模板构建的网站,因为我只是在设计方面。我想如果我可以在Dreamweaver中编辑.mako文件并让它像使用HTML一样渲染文件,那么工作会更快。
我已经设置了AMP服务器来在Dreamweaver中开发,我希望我能以同样的方式使用Paster webserver。但是,为了方便起见,我希望在Dreamweaver中有一个扩展或设置,这样我就可以像普通的基于HTML的网站一样对待它 - 这就是.mako基本上就是HTML(比如PHP)上有一个.mako扩展名。
目前,我的Extensions.txt文件包含以下内容:
HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML,JSP,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODULE,PROFILE,ENGINE,SVG,MAKO:All Documents
HTM,HTML,HTA,HTC,XHTML,MAKO:HTML Documents
SHTM,SHTML,STM,SSI,INC:Server-Side Includes
JS,JSON:JavaScript Documents
XML,DTD,XSD,XSL,XSLT,RSS,RDF:XML Files
LBI:Library Files
DWT:Template Files
CSS:Style Sheets
ASP,ASA:Active Server Pages
ASPX,ASCX,ASMX,CS,VB,CONFIG,MASTER:Active Server Plus Pages
CFM,CFML,CFC:ColdFusion Templates
AS:ActionScript Files
ASC:ActionScript Communication Files
ASR:ActionScript Remote Files
TXT:Text Files
PHP,PHP3,PHP4,PHP5,TPL,PHP-DIST,PHTML:PHP Files
LASSO:Lasso Files
JSP,JST:Java Server Pages
JSF:Fireworks Script
TLD:Tag Library Descriptor Files
JAVA:Java Files
SQL:SQL Files
ASX:Windows Media Advanced Stream Redirector
WML:WML Files
EDML:EDML Files
VBS:VBScript Files
VTM,VTML:VTML Files
SVG:Scalable Vector Graphics Files
请注意,MAKO引用位于第一行,如:所有文档,再次位于:HTML文档
这是我的MMDocumentTypes.xml文档,其中包括最后一个条目附近。
<?xml version="1.0"?>
<documenttypes xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
<documenttype id="HTML" internaltype="HTML" winfileextension="html,htm,shtml,shtm,stm,tpl,lasso,xhtml,mako" macfileextension="html,htm,shtml,shtm,tpl,lasso,xhtml,mako,ssi" file="Default.html" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_0" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_1" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="ASP-JS" servermodel="ASP JavaScript" internaltype="Dynamic" winfileextension="asp" macfileextension="asp" file="Default_js.asp" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_4" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_5" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="ASP-VB" servermodel="ASP VBScript" internaltype="Dynamic" winfileextension="asp" macfileextension="asp" file="Default_vb.asp" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_2" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_3" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="ColdFusion" servermodel="ColdFusion" internaltype="Dynamic" winfileextension="cfm,cfml" macfileextension="cfm,cfml" file="Default.cfm" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_6" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_7" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="CFC" servermodel="ColdFusion" internaltype="Dynamic" winfileextension="cfc" macfileextension="cfc" file="Default.cfc" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_56" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_57" />
</description>
<dtdcontext>none</dtdcontext>
</documenttype>
<documenttype id="JSP" servermodel="JSP" internaltype="Dynamic" winfileextension="jsp,jst" macfileextension="jsp,jst" file="Default.jsp" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_8" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_9" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="ASP.NET_VB" servermodel="ASP.NET VB" internaltype="Dynamic" winfileextension="aspx,ascx,asmx" macfileextension="aspx,ascx" file="Default_vb.aspx" writebyteordermark="true" newdocumentname="WebForm" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_12" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_13" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="ASP.NET_CSharp" servermodel="ASP.NET C#" internaltype="Dynamic" winfileextension="aspx,ascx,asmx" macfileextension="aspx,ascx" file="Default_cs.aspx" writebyteordermark="true" newdocumentname="WebForm" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_10" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_11" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,phtml" macfileextension="php,php3,php4,php5,phtml" file="Default.php" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_14" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_15" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="JavaScript" internaltype="Text" winfileextension="js,json" macfileextension="js,json" file="Default.js" writebyteordermark="false" mimetype="text/javascript">
<TITLE>
<MMString:loadString id="mmdocumenttypes_16" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_17" />
</description>
</documenttype>
<documenttype id="VBScript" internaltype="Text" winfileextension="vbs" macfileextension="vbs" file="Default.vbs" writebyteordermark="false" mimetype="text/vbscript">
<TITLE>
<MMString:loadString id="mmdocumenttypes_18" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_19" />
</description>
</documenttype>
<documenttype id="Csharp" internaltype="Text" winfileextension="cs" macfileextension="cs" file="Default.cs" writebyteordermark="false" mimetype="text/cs">
<TITLE>
<MMString:loadString id="mmdocumenttypes_20" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_21" />
</description>
</documenttype>
<documenttype id="VB" internaltype="Text" winfileextension="vb" macfileextension="vb" file="Default.vb" writebyteordermark="false" mimetype="text/vb">
<TITLE>
<MMString:loadString id="mmdocumenttypes_22" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_23" />
</description>
</documenttype>
<documenttype id="Java" internaltype="Text" winfileextension="java" macfileextension="java" file="Default.java" writebyteordermark="false" mimetype="text/java">
<TITLE>
<MMString:loadString id="mmdocumenttypes_24" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_25" />
</description>
</documenttype>
<documenttype id="DWTemplate" internaltype="DWTemplate" winfileextension="dwt" macfileextension="dwt" file="Default.dwt" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_26" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_27" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="EDML" internaltype="XML" winfileextension="edml,edm" macfileextension="edml,edm" file="Default.edml" writebyteordermark="false" mimetype="text/xml" >
<TITLE>
<MMString:loadString id="mmdocumenttypes_28" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_29" />
</description>
<dtdcontext>none</dtdcontext>
</documenttype>
<documenttype id="CSS" internaltype="Text" winfileextension="css" macfileextension="css" file="Default.css" writebyteordermark="false" mimetype="text/css" >
<TITLE>
<MMString:loadString id="mmdocumenttypes_30" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_31" />
</description>
</documenttype>
<documenttype id="XML" internaltype="XML" winfileextension="xml,xsd,rss,rdf,dtd,vtm,vtml,csn,config,mxi" macfileextension="xml,xsd,rss,rdf,dtd,vtm,vtml,csn,config,mxi" file="Default.xml" writebyteordermark="false" mimetype="text/xml" >
<TITLE>
<MMString:loadString id="mmdocumenttypes_32" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_33" />
</description>
<dtdcontext>xml</dtdcontext>
</documenttype>
<documenttype id="Actionscript" internaltype="Text" winfileextension="as" macfileextension="as" file="Default.as" writebyteordermark="false" mimetype="text/as" >
<TITLE>
<MMString:loadString id="mmdocumenttypes_34" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_35" />
</description>
</documenttype>
<documenttype id="Text" internaltype="Text" winfileextension="txt" macfileextension="txt" file="Default.txt" writebyteordermark="false" mimetype="text/plain" >
<TITLE>
<MMString:loadString id="mmdocumenttypes_36" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_37" />
</description>
</documenttype>
<documenttype id="WML" internaltype="XML" winfileextension="wml" macfileextension="wml" file="Default.wml" writebyteordermark="false" mimetype="text/xml">
<TITLE>
<MMString:loadString id="mmdocumenttypes_38" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_39" />
</description>
<dtdcontext>wml</dtdcontext>
<dtdcontext>required</dtdcontext>
</documenttype>
<documenttype id="TLD" internaltype="XML" winfileextension="tld" macfileextension="tld" file="Default.tld" writebyteordermark="false" mimetype="text/xml">
<TITLE>
<MMString:loadString id="mmdocumenttypes_58" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_59" />
</description>
<dtdcontext>jsp_tag_library</dtdcontext>
<dtdcontext>required</dtdcontext>
</documenttype>
<documenttype id="LibraryItem" internaltype="HTML" winfileextension="lbi" macfileextension="lbi" file="Default.lbi" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_40" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_41" />
</description>
<dtdcontext>none</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_ASPVB" internaltype="DWTemplate" dynamicid="ASP-VB" winfileextension="dwt.asp" macfileextension="dwt.asp" file="Default_vb.dwt.asp" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_42" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_43" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_ASPJS" internaltype="DWTemplate" dynamicid="ASP-JS" winfileextension="dwt.asp" macfileextension="dwt.asp" file="Default_js.dwt.asp" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_44" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_45" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_CF" internaltype="DWTemplate" dynamicid="ColdFusion" winfileextension="dwt.cfm" macfileextension="dwt.cfm" file="Default.dwt.cfm" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_46" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_47" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_JSP" internaltype="DWTemplate" dynamicid="JSP" winfileextension="dwt.jsp" macfileextension="dwt.jsp" file="Default.dwt.jsp" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_48" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_49" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_AXCS" internaltype="DWTemplate" dynamicid="ASP.NET_CSharp" winfileextension="dwt.aspx" macfileextension="dwt.aspx" file="Default_cs.dwt.aspx" writebyteordermark="true" newdocumentname="WebForm" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_50" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_51" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_AXVB" internaltype="DWTemplate" dynamicid="ASP.NET_VB" winfileextension="dwt.aspx" macfileextension="dwt.aspx" file="Default_vb.dwt.aspx" writebyteordermark="true" newdocumentname="WebForm" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_52" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_53" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="DWTemplate_PHP" internaltype="DWTemplate" dynamicid="PHP_MySQL" winfileextension="dwt.php" macfileextension="dwt.php" file="Default.dwt.php" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_54" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_55" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="ASComm" internaltype="Text" winfileextension="asc" macfileextension="asc" file="Default.asc" writebyteordermark="false" mimetype="text/asc">
<TITLE>
<MMString:loadString id="mmdocumenttypes_60" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_61" />
</description>
</documenttype>
<documenttype id="ASRemote" internaltype="Text" winfileextension="asr" macfileextension="asr" file="Default.asr" writebyteordermark="false" mimetype="text/asr">
<TITLE>
<MMString:loadString id="mmdocumenttypes_62" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_63" />
</description>
</documenttype>
<documenttype id="XSLT" servermodel="XSLT" internaltype="XSLT" dynamicid="XSLT" winfileextension="xsl,xslt" macfileextension="xsl,xslt" file="Default.xsl" writebyteordermark="false" mimetype="text/xsl">
<TITLE>
<MMString:loadString id="mmdocumenttypes_66" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_67" />
</description>
<dtdcontext>xslt</dtdcontext>
<dtdcontext>required</dtdcontext>
</documenttype>
<documenttype id="XSLT-fragment" servermodel="XSLT" internaltype="XSLT" dynamicid="XSLT" winfileextension="xsl,xslt" macfileextension="xsl,xslt" file="Default-fragment.xsl" writebyteordermark="false" mimetype="text/xsl">
<TITLE>
<MMString:loadString id="mmdocumenttypes_68" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_69" />
</description>
<dtdcontext>none</dtdcontext>
<dtdcontext>required</dtdcontext>
</documenttype>
<documenttype id="MAKO" internaltype="HTML" winfileextension="mako" macfileextension="mako" file="Default.mako" writebyteordermark="false" mimetype="text/html">
<TITLE>
<MMString:loadString id="mmdocumenttypes_74" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_75" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>
<documenttype id="SVG" internaltype="XML" winfileextension="svg" macfileextension="svg" file="Default.svg" writebyteordermark="false" mimetype="text/xml" >
<TITLE>
<MMString:loadString id="mmdocumenttypes_72" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_73" />
</description>
<dtdcontext>svg</dtdcontext>
<dtdcontext>required</dtdcontext>
</documenttype>
</documenttypes>
非常感谢任何帮助。
答案 0 :(得分:0)
您需要将.mako扩展名添加到Extensions.txt文件中,并在MMDocumentTypes.xml文件中为其指定文件类型。有一个TechNote涵盖了这两个说明,还提供了文件位置。
答案 1 :(得分:0)
正如JCL1178所指出的,不是在MMDocumentTypes.xml中创建新的XML条目,而是尝试将MAKO添加到winfileextension和macfileextension下的第一个HTML条目。这对我有用。
您确定要从首选项中的“在代码视图中打开”扩展名中删除它吗?
在代码视图中打开
“在代码视图中打开”首选项标识可执行的文件扩展名 不允许设计视图。按照此处的说明操作后 技术说明,请务必从中删除文件扩展名(如果已列出) 打开代码视图首选项以允许在“设计”视图中编辑文件。 要设置此首选项,请选择编辑&gt;首选项(Windows)或 Dreamweaver&gt;首选项(Mac OS),并找到文件类型/ 编辑类别。