Assemble Web page from HTML template, CSS template and HTML content pages

1162 views javascript
3

I have a site where most pages have the same layout, only content and possibly the background image is the same. Same HTML and CSS, with only difference in section and background-image. This is what I have been doing when I create a new page:

  • Create a clean HTML file with the content I want to add - new_content.html, and a background image new_content.jpg to go with it
  • Make a copy of HTML template page and name it new_page.html
  • Copy the contents of new_content.html to in new_page.html.
  • Modify the CSS to set the background.
  • On index.html, create a link to the new page.

There is a lot of repetition, and identical pages with only one div difference. I would also like to separate the content from page design, so that I could simply add a link on index.html that would do something like [mix of HTML and pseudocode only to illustrate what I want to do]:

<a href="page_template.html(new_content.html, new_content.jpg)>

I am new to this all, just trying to streamline how to make my own page work. Javascript I can cut and paste, and usually figure out how it works.

answered question

There are many templating systems and approaches - but investigate the <template></template> html5 tag. Its great, but IE doesn't support it as well as other browsers.

php templates might be the go duckduckgo.com/…

Thank you. When I am ready to jump into PHP, I will know where to look. The problem really was that I did not know how to formulate my duckduckgo, so I wouldn't just be offered 'ready-made web site templates.'

1 Answer

1

You can't. HTML is static. To create dynamic content you need something like PHP, XML/XSL or a CMS (Content Management System).

posted this

Have an answer?

JD

Please login first before posting an answer.