简体   繁体   English

Dreamweaver嵌套模板

[英]Dreamweaver nested templates

So I'm trying to achieve something like this in Dreamwaver CS5. 所以我想在Dreamwaver CS5中实现类似的功能 I have one optional editable region (optional because I do not want that thing in certain webpages) and another editable region in my "master" template. 我有一个可选的可编辑区域(可选,因为我不希望某些网页中的那个)和我的“主”模板中的另一个可编辑区域。 So what I'm doing now is to create a new template from my master template, and then change the optional editable region to be displayed, saving it as a new template, and finally creating new webpages from the new template. 所以我现在正在做的是从我的主模板创建一个新模板,然后更改要显示的可选可编辑区域,将其保存为新模板,最后从新模板创建新的网页。

Unfortunately, it seems everything that was editable in the new template is editable in the new webpage I just created. 不幸的是,似乎在新模板中可编辑的所有内容都可以在我刚刚创建的新网页中编辑。 I want only the non-optional editable region in the master template to be editable in all new webpages created from the new template. 我希望只有主模板中的非可选可编辑区域可以在从新模板创建的所有新网页中进行编辑。 How can I accomplish this? 我怎么能做到这一点?

It's annoyingly simple (and kind of strange). 这很烦人(也有点奇怪)。

In the second-level template, add this expression: @@("")@@ anywhere in the editable region you want to lock. 在第二级模板中,在要锁定的可编辑区域中的任何位置添加此表达式: @@("")@@ Now all pages derived from that template will display it as non-editable. 现在,从该模板派生的所有页面都将显示为不可编辑的页面。


You can do some fun things with Dreamweaver's template expressions and variables, but finding any real documention has proven difficult. 您可以使用Dreamweaver的模板表达式和变量做一些有趣的事情,但是发现任何真实的文档都很困难。 Mainly because it's essentially useless if you can use PHP. 主要是因为如果你可以使用PHP它基本上没用。 And it took some time figuring out that @@(lang!="fin"?(lang=="swe"?"Swedish title":"English title"):"Finnish title")@@@@(sub!=""?" :: "+sub:sub)@@ was the specific expression i wanted for a non-PHP client's page title. 花了一些时间搞清楚@@(lang!="fin"?(lang=="swe"?"Swedish title":"English title"):"Finnish title")@@@@(sub!=""?" :: "+sub:sub)@@是我想要的非PHP客户端页面标题的特定表达式。 So, yeah. 是的。

When you add a new editable region in an editable region passed through to the nested template, the highlighting color of the editable region changes to orange. 在可传递到嵌套模板的可编辑区域中添加新的可编辑区域时,可编辑区域的突出显示颜色将更改为橙色。 Content you add outside the editable region, such as the [blah], is no longer editable in documents based on the nested template 您在可编辑区域外添加的内容(例如[blah])在基于嵌套模板的文档中不再可编辑

source http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7aa1a.html 来源http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7aa1a.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM