How to automatically update/synchronize HTML code from one page to another in Dreamweaver CS5?

ぃ、小莉子 提交于 2019-12-13 19:27:42

问题


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


回答1:


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.




回答2:


I'd recommend using a programming language like PHP in addition to HTML, and use <?php include("file"); ?> to include code from your main page.

Most web hosts support PHP, and if not, they probably support Perl, Python or any other language to use in web applications.



来源:https://stackoverflow.com/questions/4471050/how-to-automatically-update-synchronize-html-code-from-one-page-to-another-in-dr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!