I think all of you have done the redesign assignment already and starting to write the report. When you are redesigning the web, I think most of you may have faced a certain problem in mind that is how to make all the pages consistent? As all the pages will have the same html opening tags, meta tags, linking of the style sheets, header navigation bar and the footer copyright declaration part. If I simply copy and paste it to every page, it is time consuming and not easy to maintain in the future. So I want to introduce a few methods here.
I think I don’t need to talk too much about frames, it is just a standard HTML tag that is easy to implement. It will divide the screen into areas which each area will load it’s corresponding page.
The advantage is that it is server independent, any web hosting services can run it. However there are a bunch of problem using frames to achieve consistency which are shown below.
- Browser don’t know what to bookmark
- Opening the source will open the frameset but not the page
- Search engine will have problem crawling the pages
Client Side Include
Hard to maintain
Search engine won’t be able to crawl because it is made at client side
Server Side Include
In contrast, server side include is done by some server side scripting. It can be some simple ones like the SHTML or some complicated ones like PHP, ASP or JSP. The pros of server side include is that it can totally eliminate all the disadvantages in the previous methods. However the main disadvantage is that it is server dependent, and it is sad that CityU personal web do not support these.
The example of SHTML is illustrated below:
<!–#include file=”header.html”–> <body> …… </body> <!–#include file=”footer.html”–>
<!DOCTYPEhtml PUBLIC “-//W3C//DTD XHTML 1.1//EN”"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”zh-tw”>
More resources and tutorials
How do I include another file inside a HTML file?
How do I include one HTML file in another?