HTML 静态文件模板的可用选项
为静态页面模板化 HTML 文件以最大程度地减少维护和冗余的最常见选项是什么?我的问题的一个例子是 Adobe Dreamweaver。
What are the most common options for templating HTML files for static pages, to minimize maintenance and redundancy? An example of my question would be Adobe Dreamweaver.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
考虑使用服务器端脚本语言,例如 PHP 或 ASP.NET。这些会生成动态构建的网页,这意味着您可以采用将页眉/页脚等与主要内容分开的方式对其进行编码,这意味着您可以更改该链接一次而不是 30 次。
如果服务器端脚本不是一个选项,我建议看看 Dreamweaver。这将使您能够创建模板,然后基于这些模板创建页面。当您修改模板中的该链接时,使用该模板的所有页面都将被更新。这将为您提供所需的内容,而无需服务器端脚本编写。
Consider using a server-side scripting language such as PHP or ASP.NET. These produce dynamically built web-pages meaning that you can code it in such a way that headers/footers etc are separate from the main content, meaning you change that link once rather than 30 times.
If server-side scripting is not an option, I'd suggest having a look at Dreamweaver. This will enable you to create templates, and then create pages based on those templates. When you modify that link in the template, all pages that use that template will be updated. This will give you what you want without the server-side scripting.
为什么不在里面使用 iframe 呢? (其中将包含一个导航 html 页面...)?
why dont you use iframe inside ? ( which will contain a single navigation html page...)?
如果您使用的是 PHP 等服务器端语言,则可以开始使用 include< /a> 函数。因此,您将在不同的文件中包含导航栏,然后将其包含在网站的每个文件中。因此,对导航栏文件的每次更改都会影响所有其他文件。
如果您只编写静态页面,这是不可能的。也许您可以尝试SSI。
If you're using a server-side language like PHP, you can start to use the include function. So you'll include in a different file your navigation bar and then include it in every file of your website. Thus, every change to the navigation bar file will affect all the others files.
If you are writing only static pages, it isn't possible. Maybe you can try SSI.
通常,您需要一个精美的程序(例如 Dreamweaver 及其模板功能)或某种服务器端脚本。如果您只想做您所描述的那样,那么像 php、asp 等语言可能有点多,所以我可能会看看您的服务器是否支持服务器端包含(SSI)。
Typically you need either a fancy program (like Dreamweaver and its templates functionality) or some sort of server-side scripting. Languages like php, asp, etc might be a bit much if the only thing you are looking to do is as you describe, so I might look into seeing if your server support server side includes (SSI).