Support > Documentation > Templating & Design > How ExSite Creates Web Pages

How ExSite Creates Web Pages

This document describes, in moderate technical detail, how ExSite constructs web pages for display on client browsers. It is intended as a primer for technically-oriented graphic designers who will be tinkering with templating tools at an advanced level, and as an introduction to the ExSite content management framework for web developers.

Before reading this document, it would be wise to brush up on ExSite's Content Model.

Overview

ExSite manages any number of websites (or website sections) that are collections of individual web pages.

Every web page produced by ExSite has both a static and dynamic representation. The static version is prepublished to disk, and is served as a traditional HTML document. The dynamic version is composed on the fly by the webserver, and served to the viewer immediately.

If the web page publishes to a simple HTML file and contains no recursive web applications, then the static representation of the page is the only one the public will normally see. A static web page typically has a URL that ends in filename.html. On the server side, this really is a simple, flat HTML file.

If the web page is configured to always render dynamically, then the dynamic representation is the one the public will normally see. A dynamic web page typically has a URL that ends in page.cgi/filename.html.

If the web page publishes to a simple HTML file, but contains web applications that may regenerate the page content, then the web page can appear both ways. The default view of the page will be published to a static file (and will appear as filename.html), but the page can be regenerated under different conditions (in which case subsequent page views appear as page.cgi/filename.html...).

In most cases, ExSite will automatically choose whether to display the static or dynamic representation of the page. Generally, it chooses the static representation (which is usually better for performance), unless one of the following is true:
  1. the page has restricted access. In this case, ExSite chooses dynamically whether to display the page, or issue an authentication challenge.
  2. the page has accepted parameters or form inputs to regenerate itself with different content.
  3. an administrator is previewing a new version of the page that has not been published yet.
  4. an administrator has explicitly configured the page to always render dynamically. (This is done in cases where the page is displaying content that changes too quickly to make republishing the page practical, such as with some database reports.)

Page identifiers

Pages can be referred to by their filename, or by their numeric page ID (the _id parameter to page.cgi). Either identifier can be used to locate the page.

Note however, that every page in the system has a unique page ID, but only pages in a particular site/section have a unique filename. If you specify a page by filename, ExSite will only look in the current site for a matching page.

How ExSite finds content

All page content is located in content objects, which have various names (text labels) that identify the content. For example, a particular block of text might be called "body" because it comprises the main body of text on a page. An image might be called logo, or banner_ad, or MyPhoto, or PZ10114s.jpg. The names are arbitrary - it's nice if they are meaningful to you, but ExSite doesn't really care.

A page is a collection of references to different content objects (eg. text, images, stylesheets, etc.) that are assembled to create the final page. Each time a new content object is referenced, ExSite must find that content object somewhere in the system. Here is how it searches:
  • First, it looks inside the page that is being built. Each page can define its own content objects that are unique to that page.
  • Next, it looks inside the graphic design template that the page uses to format itself. Each template can define content objects that can be used by every page that uses it. If the graphic design is derived from (or "spun off of") another graphic design, then those parent design(s) are also checked to see if they define our missing content object.
  • Next it looks inside any content libraries that exist in the current site or site section. Content libraries are places to put re-useable content objects that might need to be shared by different pages. ExSite will also look in shared content libraries in our parent sections and sites, in case the content is being provided to us by another site.
ExSite takes the first match it finds. If we're looking for a content object called logo, then a match in the current page is preferred over a match in the graphic design template, which is preferred to a match in the libraries. Note that matches might exist in all of these locations, but the preferred versions override the others. (This lets you define general-purpose content that will be used as a fall-back in cases where specific content has not been provided.)

How ExSite builds a page

To begin constructing a page, ExSite needs an initial starting point. It looks for a content object named page to begin. It searches for this content object using the above algorithm.

The page content object provides the initial HTML framework for the page. That is, when we load the page content object, and ask it for it's actual content data, we will receive a block of HTML that lays out the overall page structure, and will refer to other content objects that are needed to complete the page (such as images, stylesheets, menus, and text). These references to other content objects are specified using special tags in the HTML that are understood by ExSite (although they will look like HTML comments to any other HTML-handling program).

To illustrate, here is a very simple example of the type of HTML content that you might get in a "page" content object:
<html>
<head>
<title><!--$title--></title>
</head>
<body>
<img src="/base_2017/logo.html">
<!--content(body)-->
</body>
</html>
From this you can see that the bare essentials of the page are included: a head section, a body section, and a few other items inside those. A more realistic example would probably include all sorts of layout instructions (tables, divs, css, javascript, etc.).

There are three special tags in this example that refer to other content objects that are needed to complete the page:
<!--$title-->
This tells ExSite to insert the appropriate meta-data into this spot. Meta-data is not really content, but it can be inserted into the page just like content can.
/base_2017/logo.html
This tells ExSite to insert a URL to the logo content object into this spot. ExSite will perform a search for logo (as described above), and when it is found, will determine the best URL to use.
<!--content(body)-->
This tells ExSite to insert the HTML for the body content object into this spot. ExSite will perform a search for body (as described above), and when it is found, will determine the best HTML representation of the content to use.

Once these substitutions are complete, ExSite looks at the new, expanded, version of the page's HTML. New content references may have appeared as a result of the substitutions we performed, in which case, we have to repeat the process and search for the missing content, until no more references can be found. At that point, the page construction is complete, and it can be delivered to its destination - either the client browser (if the page is being rendered dynamically) or the publishing program (if the page is meant to be viewed statically).

More information on how to use substitution tags is given in the ExSite Templating Guide.

Topics

google (5 items)
RSS (3 items)
SEO (3 items)
plug-in modules (28 items)
IT (9 items)
best practices (5 items)
visual tutorial (29 items)
security (3 items)
data handling (7 items)
fundamentals (3 items)
graphic design (19 items)
web protocols (9 items)
programming (48 items)
html formatting (7 items)
POD (32 items)
events (8 items)