本文介绍了如何在Dreamweaver CS5中自动更新/同步HTML代码从一个页面到另一个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Dreamweaver CS5中构建了一个基本网站,其中许多页面都从一个主页共享大量HTML代码。由于我不得不经常更新这个主页面,我想知道是否有办法在每次更改主页面中的代码时自动更新/同步其他页面中的相关共享代码?目前,我有过到的代码块复制并粘贴到这是一个有点费力的,至少可以说


解决方案
转到文件>新建,并选择页面类型作为html模板。

Html模板基本上是一个html文件。并附带一些专门用于Dreamweaver的注释标签。您可以使用任何html文件作为html模板。在html模板中,您可以定义可编辑区域



一旦您定义了html模板,则需要将其应用于其他html页面。打开一个普通的html文件,然后转到修改>模板>将模板应用到页面上。



现在形成无论您在模板页面上修改了什么,它都会反映在使用该模板的其他页面。可编辑区域中的内容将保持原样。

I am building a basic website in Dreamweaver CS5 where many of the pages share a lot of the HTML code from one main page. As I am having to update this main page frequently I am wondering if there is a way to have the relevant shared code in the other pages update/sync automatically each time I make a change to the code in the main page? At the moment I am having to copy and paste the chunks of code over to each page which is a little laborious to say the least

解决方案

You can create templates in Dreamweaver. Goto file > new and choose page type as html template.

Html template is basically a html file. with some comment tags specially for dreamweaver. You can use any of your html file as html template. In html template you can define editable regions

once you define html template you need to apply it to other html pages. Open a normal html file and goto Modify > Template > apply template to page.

Form now onwards whatever you modify on template page it would reflect in other pages which use that template. The content in the editable regions will be kept as it is.

这篇关于如何在Dreamweaver CS5中自动更新/同步HTML代码从一个页面到另一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 16:03