2

理想情况下,我希望能够处理在 Dreamweaver 中使用 Mako 模板构建的网站,因为我只是在设计方面工作。我想如果我可以在 Dreamweaver 中编辑 .mako 文件并让它像使用 HTML 一样渲染文件,工作会更快。

我已经设置了 AMP 服务器以在 Dreamweaver 中进行开发,我希望我可以以同样的方式使用 Paster 网络服务器。而且,不过,为了方便起见,我想在 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 引用在第一行,如 :All Documents,然后在 :HTML Documents 中

这是我的 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>

对此的任何帮助将不胜感激。

4

2 回答 2

0

正如 JCL1178 所指出的,不要在 MMDocumentTypes.xml 中创建新的 XML 条目,而是尝试将 MAKO 添加到 winfileextension 和 macfileextension 下的第一个 HTML 条目。这对我有用。

您是否确保将其从“首选项”中的“在代码视图中打开”扩展中删除?

在代码视图中打开

在代码视图中打开首选项标识不允许设计视图的文件扩展名。按照本技术说明中的说明进行操作后,请务必从“在代码视图中打开”首选项中删除文件扩展名(如果已列出),以允许在“设计”视图中编辑文件。要设置此首选项,请选择编辑 > 首选项 (Windows) 或 Dreamweaver > 首选项 (Mac OS),然后找到文件类型/编辑器类别。

于 2012-11-06T04:20:17.010 回答
0

您需要将 .mako 扩展名添加到 Extensions.txt 文件,并在 MMDocumentTypes.xml 文件中为其分配文件类型。有一个技术说明涵盖了这两个说明,还提供了文件位置。

于 2012-04-07T06:31:29.640 回答