Create a simple web site

This chapter explains step by step how to build a sort of static web-site using Wombat.

Sitemap

Sitemap of www.example.com
index
 \
  + imprint
  + about
  |    \
  |     + boss
  |     + employees
  |     + branches
  |
  + products
        \
        + things
        + stuff

Imagine you have to implement a simple static web site for www.example.com. The sitemap looks pretty straight forward, still you don't know how to implement such a simple site with Wombat.

The sitemap results in the following URLs, that need to be servered wioth proper content:

Page Layout

The site's layout is quiet simple, as well. There is a static logo area the top, A big main content area, we are going to call main and the menu area on the right. Both, the logo and the menu contain static HTML content, hence we put their content right in the basic template.

Site Configuration

First, create a folder site and site/page and a the file site.xml in etc-default.

The site.xml has two section: skin and content. In skin section you tell which template you want to use. The tag tmpl contains "site", that mean to load the template file name template/site.tmpl as a frame template. Also it fills the placeholder \{COONTENT\}.

The content part must contain have a renderer and a content section. The renderer Template uses patTemplate to glue the content's strings together. Hence this renderer needs to know which template file to use, "main" in this case. Actually, the renderer is just another content component module named Composite. So template file in question is located in template/Composite/main.tmpl.

Content of site.xml site Template main Static index

HTML Templates

Wombat utilizes patTemplate from PHP Application Tools. That's way static HTML is stored in template files. More information about this topic can be found at the template engine intro page