{"id":199339,"date":"2025-05-03T13:49:07","date_gmt":"2025-05-03T05:49:07","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199339\/"},"modified":"2025-05-03T13:49:07","modified_gmt":"2025-05-03T05:49:07","slug":"ecshop%e4%b8%adtemplatebegineditable-%e5%92%8c%e5%90%8e%e5%8f%b0%e7%bc%96%e8%be%91%e8%ae%b2%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199339\/","title":{"rendered":"ECshop\u4e2dTemplateBeginEditable \u548c\u540e\u53f0\u7f16\u8f91\u8bb2\u89e3"},"content":{"rendered":"<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u5728ecshop\u7684dwt\u6587\u4ef6\u91cc\u9762\u7ecf\u5e38\u53d1\u73b0\u6709\u201c&lt;!&#8211; TemplateBeginEditable name=&#8221;doctitle&#8221; &#8211;&gt;\u548c&lt;!&#8211; #BeginLibraryItem &#8220;\/library\/page_header.lbi&#8221; &#8211;&gt;&lt;!&#8211; #EndLibraryItem &#8211;&gt;\u201d\u8fd9\u4e48\u4e00\u6bb5\u4ee3\u7801,\u6709\u5f88\u591a\u670b\u53cb\u8bef\u8ba4\u4e3a\u53ea\u662f\u6ce8\u91ca\u7528\u7684\uff0c\u8fd9\u91cc\u9996\u5148\u6765\u4ecb\u7ecd\u4e00\u4e0b#BeginLibraryItem\u8fd9\u6bb5\u4ee3\u7801\u3002\u53ef\u4ee5\u770b\u5230\u540e\u9762\u6709\u201cpage_header.lbi\u201c\u8fd9\u4e2a.lbi\u6587\u4ef6\u662f\u4e00\u4e2a\u5e93\u6587\u4ef6\uff0c\u6253\u5f00\u540e\u53d1\u73b0\u91cc\u9762\u5c31\u662f\u4e00\u4e9bhtml\u4ee3\u7801\uff0cindex.dwt\u4e3a\u6a21\u677f\uff0c\u90a3\u4e48\u8fd9\u4e2a.lbi\u53ef\u4ee5\u7406\u89e3\u4e3a\u6a21\u677findex.dwt\u7684\u5b50\u6a21\u677f\uff0c.lbi\u4e13\u95e8\u4f9b\u522b\u7684\u7684dwt\u6a21\u677f\u5bfc\u5165\u7684\u5b50\u6a21\u677f. \u90a3\u4e48 TemplateBeginEditable\u8fd9\u4e2a\u53c8\u662f\u5e72\u4ec0\u4e48\u7528\u7684\u5462\uff1f \u5f88\u591a\u4eba\u77e5\u9053\u8fd9\u4e2a\u662f\u53ef\u7f16\u8f91\u533a\u57df\u7684\u610f\u601d\uff0c\u610f\u601d\u5c31\u662f\u5728TemplateBeginEditable \u548c TemplateEndEditable\u4e4b\u95f4\u7684\u4f4d\u7f6e\u662f\u53ef\u7f16\u8f91\u533a\u57df\uff0c\u5177\u4f53\u7684\u6211\u4eec\u6765\u4e3e\u4e2a\u4f8b\u5b57\u3002\u9996\u5148\u6211\u4eec\u5230ecshop \u7ba1\u7406\u5458\u540e\u53f0\u7684\u6a21\u677f\u7ba1\u7406-&gt;\u8bbe\u7f6e\u6a21\u677f\u91cc\u9762\u53ef\u4ee5\u770b\u5230\u4ee5\u4e0b\u8fd9\u4e2a<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/141208\/1-14120Q144422M.jpg\" style=\"width: 670px;height: 385px\" class=\"aligncenter\"><br \/> &nbsp;<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u53ef\u4ee5\u770b\u5230\u4e0a\u9762\u7684\u9ed8\u8ba4\u9009\u62e9\u4e86\u9996\u9875\u6a21\u677f\uff0c\u5047\u5982\u5f53\u4f60\u5c06 \u5546\u54c1\u5206\u7c7b\u6811 \u9009\u62e9\u4e3a\u53f3\u8fb9\u4e3b\u533a\u57df \u70b9\u51fb\u786e\u5b9a\u4e4b\u540e \u6e05\u695a\u7f13\u5b58\uff0c\u5728\u5237\u65b0\u9996\u9875\u8fd9\u662f\u4f60\u4f1a\u53d1\u73b0\uff0c\u539f\u6765\u7684 \u5546\u54c1\u5206\u7c7b\u6811 \u4ece\u5de6\u8fb9\u8dd1\u5230\u53f3\u8fb9\u4e86\u3002\u5728\u4e0a\u9762\u7684\u4e0b\u62c9\u6846\u4e2d\u6211\u4eec\u770b\u5230\u53ea\u6709\u4e09\u4e2a\u9009\u62e9\uff0c\u53f3\u8fb9\u4e3b\u533a\u57df\uff0c\u5de6\u8fb9\u4e3b\u533a\u57df\uff0c\u5e7f\u544a\u4f4d\uff0c\u5982\u679c\u4f60\u60f3\u591a\u52a0\u51e0\u4e2a\u9009\u9879\uff0c\u90a3\u4e48\u5f88\u7b80\u5355\uff0c\u53ea\u8981\u4f60\u5728\u4f60\u8981\u6539\u7684\u6a21\u677f\u5185\u591a\u52a0\u4e0a\u51e0\u4e2a\u5c31\u884c\u4e86\uff0c\u5047\u5982\u4f60\u8981\u5728index.dwt\u6a21\u677f\u6dfb\u52a0&nbsp;&nbsp; \u201c\u5de6\u4e0a\u89d2\u4e3b\u533a\u57df\u201d\uff0c\u548c\u201c\u53f3\u4e0b\u89d2\u4e3b\u533a\u57df\u201d\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u5728index.dwt \u91cc\u9762\u52a0\u5165<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> &lt;!&#8211; TemplateBeginEditable name=&#8221;\u5de6\u4e0a\u89d2\u4e3b\u533a\u57df&#8221; &#8211;&gt;<br \/> &lt;!&#8211; TemplateEndEditable &#8211;&gt;<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> &lt;!&#8211; TemplateBeginEditable name=&#8221;\u53f3\u4e0a\u89d2\u4e3b\u533a\u57df&#8221; &#8211;&gt;<br \/> &lt;!&#8211; TemplateEndEditable &#8211;&gt;<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u8fd9\u662f\u4f60\u518d\u5230\u540e\u53f0\uff0c\u6a21\u677f\u8bbe\u7f6e\u91cc\u9762\u770b\u9996\u9875\u7684\u9009\u9879\u4e2d\u5c31\u6709\u8fd9\u4e2a\u9009\u9879<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/141208\/1-14120Q14456229.jpg\" style=\"width: 569px;height: 170px\" class=\"aligncenter\"><\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> &nbsp;<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u4e0b\u9762\u6211\u6765\u8bb2\u89e3\u4e00\u4e0b\u600e\u4e48\u5236\u4f5c\u81ea\u5df1\u7684\u6a21\u677f\uff0c \u6211\u62ffindex.dwt\u4e3a\u4f8b\uff0c \u9996\u5148\u5728\\themes\\default\\\u4e0b\u5c06index.dwt\u6587\u4ef6\u62f7\u8d1d\u4e00\u4efd\u6539\u540d\u4e3ahome.dwt\u5728&lt;body&gt;\u91cc\u9762\u52a0\u4e00\u53e5\u8bdd &#8220;\u8fd9\u662f\u81ea\u5df1\u5b9a\u4e49\u7684home.dwt\u6a21\u677f&#8221; \u4ee5\u65b9\u4fbf\u8c03\u8bd5, \u540c\u6837\u5728\u6839\u76ee\u5f55\u4e0b\u7684index.php\u6587\u4ef6\u62f7\u8d1d\u4e00\u4efd\u6539\u540d\u4e3ahome.php\u91cc\u9762\u52a0\u4e00\u884c echo &#8216;\u8fd9\u662f\u81ea\u5df1\u5b9a\u4e49\u7684home.php&#8217;; \u4ee3\u7801\u4ee5\u4fbf\u8c03\u8bd5 \u540c\u65f6\u628a$smarty-&gt;display(&#8216;index.dwt&#8217;, $cache_id);\u6539\u4e3a$smarty-&gt;display(&#8216;home.dwt&#8217;, $cache_id);\u7136\u540e \u6e05\u695a\u7f13\u5b58 \u5728\u6d4f\u89c8\u5668\u901a\u8fc7http:\/\/localhost\/ecshop\/home.php\u6267\u884c\u4f60\u4f1a\u53d1\u73b0\u8fd9\u4e2a\u9875\u9762\u8ddf\u9996\u9875\u4e00\u6837\uff0c\u53ea\u662f\u591a\u4e86\u4e00\u6bb5 &#8220;\u8fd9\u662f\u81ea\u5df1\u5b9a\u4e49\u7684home.php \u8fd9\u662f\u81ea\u5df1\u5b9a\u4e49\u7684home.dwt\u6a21\u677f&#8221; \u6587\u5b57\u3002 \u5f53\u7136home.php \u548chome.dwt \u6587\u4ef6\u91cc\u9762\u7684\u5185\u5bb9\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49.<br \/> \u5f53\u4f60\u518d\u5230\u540e\u53f0\u6a21\u677f\u7ba1\u7406-&gt;\u8bbe\u7f6e\u6a21\u677f \u91cc\u9762\u7684 \u9009\u62e9\u6a21\u677f\u4e0b\u62c9\u6846\u9009\u9879\u4e2d\u6ca1\u6709\u4f60\u52a0\u7684home\u6a21\u677f\uff0c\u8fd9\u65f6\u4f60\u5c31\u8981\u5728\\admin\\includes\\lib_template.php\u91cc\u914d\u7f6e\u4e00\u4e0b\u3002\u5728\u4ee3\u7801\u201d$template_files = array(&#8216;index.dwt&#8217;, \u201c \u52a0\u4e0a\u4f60\u7684\u6a21\u677f\u201d$template_files = array(&#8216;home.dwt&#8217;,&#8217;index.dwt&#8217;,\u201c \uff0c\u544a\u8bc9\u7cfb\u7edf\u6709home.dwt\u8fd9\u4e48\u4e00\u4e2a\u6a21\u677f,\u5176\u6b21\u5728$page_libs = array( \u8fd9\u4e2a\u4e8c\u4f4d\u6570\u7ec4\u91cc\u9762\u7684 &#8216;index&#8217; =&gt; array( \u8fd9\u4e2a\u6570\u7ec4\u62f7\u8d1d\u4e00\u4efd\uff0c\u6539\u540d\u4e3ahome \uff0c\u610f\u601d\u5c31\u662f\u544a\u8bc9\u7cfb\u7edf\u4f60\u8fd9\u4e2ahome\u6a21\u677f\u91cc\u9762\u53ef\u4ee5\u5bfc\u5165\u54ea\u4e9b.lbi\u6587\u4ef6.\u8fd9\u70b9\u914d\u7f6e\u8fd8\u4e0d\u591f\uff0c\u4f60\u8fd8\u8981\u5728\\languages\\zh_cn\\admin\/template.php\u8bed\u8a00\u5305\u91cc\u9762\u52a0\u4e00\u884c$_LANG[&#8216;template_files&#8217;][&#8216;home&#8217;] = &#8216;Myhome\u6a21\u677f&#8217;;\u4ee3\u7801.\u7136\u540e\u4f60\u518d\u5230\u540e\u53f0\u6a21\u677f\u7ba1\u7406-&gt;\u8bbe\u7f6e\u6a21\u677f\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u7ed3\u679c<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/141208\/1-14120Q1450N33.jpg\" style=\"width: 586px;height: 239px\" class=\"aligncenter\"><br \/> &nbsp;&nbsp;<br \/> \u4f60\u4f1a\u53d1\u73b0\u4e0b\u62c9\u6846\u4e2d\u591a\u4e86\u4e00\u4e2aMyhome\u6a21\u677f\u9009\u9879,\u5f53\u4f60\u70b9\u51fb\u65c1\u8fb9\u7684\u786e\u5b9a\u6309\u94ae\u65f6\u4f1a\u62a5\u9519\uff0c\u8fd9\u662f\u56e0\u4e3a\u4f60\u8fd8\u6709\u4e00\u4e2axml\u6587\u4ef6\u6ca1\u4fee\u6539\uff0c\u6253\u5f00themes\\default\\libs.xml\u6587\u4ef6\uff0c\u5c06 &lt;file name=&#8221;index.dwt&#8221;&gt; \u8282\u70b9\u5185\u7684\u4ee3\u7801\u62f7\u8d1d\u4e00\u4efd\u628a\u8282\u70b9\u540d\u6539\u4e3a&lt;file name=&#8221;home.dwt&#8221;&gt;\u8fd9\u65f6\u4f60\u518d\u6765\u91cd\u590d\u4e0a\u6b21\u7684\u64cd\u4f5c\u70b9\u51fb\u65c1\u8fb9\u7684\u786e\u5b9a\uff0c\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\u3002<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u63a5\u4e0b\u6765\u6211\u4eec\u5236\u4f5c.lbi\u5e93\u6587\u4ef6<br \/> \u9996\u5148\u6211\u4eec\u5728\\themes\\default\\library\\\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2ahome.lbi\u6587\u4ef6 \u91cc\u9762\u8f93\u5165&#8221;\u8fd9\u662f\u6211\u81ea\u7684lbi\u6587\u4ef6&#8221;\u7136\u540e\u5728\\admin\\includes\\lib_template.php\u6587\u4ef6\u91cc\u9762\uff0c\u4f60\u521a\u624d\u65b0\u52a0\u7684&#8217;home&#8217; =&gt; array(home\u6570\u7ec4\u91cc\u9762 \u6dfb\u52a0\u4f60\u7684home.lbi \u65e2\u5728\u8fd9\u4e2a\u6570\u7ec4\u672b\u5c3e\u52a0&#8217;\/library\/home.lbi&#8217; =&gt; 0 \u540c\u6837\u50cf\u4fee\u6539\u6a21\u677f\u4e00\u6837\u5728\\languages\\zh_cn\\admin\\template.php \u91cc\u9762\u52a0\u5165\u4e00\u884c $_LANG[&#8216;template_libs&#8217;][&#8216;home&#8217;] = &#8216;Myhome\u5e93\u6587\u4ef6&#8217;; \u4ee3\u7801 \u8fd9\u65f6\u4f60\u5230\u540e\u53f0 \u6a21\u677f\u7ba1\u7406-&gt;\u5e93\u9879\u76ee\u7ba1\u7406 \u4f60\u5c31\u4f1a\u53d1\u73b0\u521a\u521a\u4f60\u52a0\u7684\u5e93\u6587\u4ef6\u51fa\u6765\u4e86\u3002<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/141208\/1-14120Q1451M22.jpg\" style=\"width: 562px;height: 248px\" class=\"aligncenter\"><\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u91cc\u9762\u4ee3\u7801\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539<\/p>\n<p style=\"margin: 0px;padding: 0px;font-family: Arial;font-size: 14px;line-height: 26px\"> \u8fd9\u65f6\u5019\u4f60\u518d\u5230 \u6a21\u677f\u7ba1\u7406-&gt;\u8bbe\u7f6e\u6a21\u677f-&gt;\u9009\u62e9Myhome\u6a21\u677f \u786e\u5b9a\u540e\uff0c\u4e0b\u9762\u53ef\u4ee5\u53d1\u73b0\u4f60\u8981\u7f16\u8f91\u7684lbi\u51fa\u6765\u4e86\uff0c<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/141208\/1-14120Q1452RT.jpg\" style=\"width: 670px;height: 111px\" class=\"aligncenter\"> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728ecshop\u7684dwt\u6587\u4ef6\u91cc\u9762\u7ecf&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199339","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199339"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199339\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}