Templating & Design > How ExSite Creates Web Pages

How ExSite Creates Web Pages

posted on 7:55 PM, July 25, 2007
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?_id=NNN.

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?_id=NNN...).

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:


<!--$title-->


<!--content(body)-->


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.
[[logo]]
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.

Graphic design

Template Tutorial (Article)
This article is a step-by-step introduction to creating web page templates in ExSite. -- 1. Create an HTML version of your web page design -- You can create your mock-up using any web design tools you... (posted 2:01 PM, September 17, 2010)

Menus (Article)
-- ExSite Manual - Menus -- This document describes the different techniques for managing site menus in the ExSite CMS. -- Contents -- * Dynamic Context-sensitive Menus * Horizontal Menu Bars using... (posted 11:13 AM, July 16, 2010)

Introduction on renaming/editing document or image folders (Article)
A short tutorial describing how to edit Document or Photo Album folders. (posted 11:59 AM, March 4, 2010)

How to add SEO Meta Tags to your website (Article)
A short tutorial describing how to add SEO tags to your website. (posted 1:51 PM, February 22, 2010)

How to add a Survey to your website (Article)
(posted 3:00 PM, November 13, 2009)

Using the HTML Editor (Article)
* Introduction * Style Guide * Finding your way around the editor * Entering Text * Copy-and-Paste Issues * Formatting Text * Unformatting Text * Entering Images * Making Hotlinks * Making... (posted 9:14 AM, October 8, 2009)

Website Manager Module (Article)
-- Introduction -- The website manager is the application that is used for: * managing (creating and deleting) sites * managing pages, templates, and content libraries * updating content (by editing... (posted 3:37 PM, October 2, 2009)

Feedback (Article)
Solicit email comments from your readers. (posted 3:11 PM, July 21, 2008)

CMS (Article)
Advanced Content Management (posted 2:32 PM, July 21, 2008)

PrintFriendly (Article)
Make a printer-friendly view of the page. (posted 1:29 PM, May 28, 2008)

Gallery (Article)
Displays a photo album as a thumbnail gallery. (posted 1:19 PM, May 28, 2008)

Google (Article)
Puts a Google search form into your site. (posted 12:32 PM, May 28, 2008)

DMenu (Article)
DMenu generates dynamic drop-down menus. (posted 11:45 AM, May 28, 2008)

SimpleMenu (Article)
SimpleMenu generates context-sensitive menus and site maps in various formats. (posted 11:18 AM, May 28, 2008)

How this site was designed in ExSite (Article)
The redesign of the ExSite Support Site offers up a good real-world example of how to set up and install a new graphic design completely from scratch. This provides a good review of some universal web... (posted 5:42 PM, April 21, 2008)

Editing Best Practices (Article)
When entering new content into your web site, certain practices are best followed to ensure you end up with professional-looking and maintainable results. -- DO NOT USE the font face, font size, and... (posted 2:34 AM, July 26, 2007)

Advanced Templating Concepts (Article)
-- Analyzing Page Structure -- Your page structure consists of numerous different elements that can be managed separately. Some are obviously separate, such as images and stylesheets, while others are... (posted 2:15 AM, July 26, 2007)

Creating Templates (Article)
-- Templating Basics -- A template is a model page, which defines how the content of real pages should be laid out, decorated (enhanced with colors and graphics), and typographically styled. A template... (posted 1:53 AM, July 26, 2007)

Graphic Design Best Practices (Article)
-- Page Structure -- A page is typically broken into several regions, each holding a block of content that is independent of the others. For example, a common page structure uses a 3-column layout,... (posted 1:26 AM, July 26, 2007)

Templating Best Practices (Article)
HTML and CSS can be combined in a myriad of ways. Some of these will be friendly to ExSite's CMS assumptions, and others will make content management difficult or inconsistent. This document guides ... (posted 12:46 AM, July 26, 2007)

How ExSite Creates Web Pages (Article)
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... (posted 7:55 PM, July 25, 2007)

RSS

permalink Link