Templates: The Basics
When you click "New Page" in the "File Manager" tab, a list of possible new pages is displayed from the template folder on your production server. New Page Templates are specific to a "Site". If your account is set up to allow multiple sites, you can assign New Page Templates uniquely for each different site.
Default Location
As a general rule this folder is named 'templates' and is located in the resources folder at root directory of the production server (this can be configured differently if desired). You or your web designer can update this folder and add new templates to the system at any time. New Page Templates are represented to the user as thumbnail graphics.
Each New Page Template requires three files...
- .tmpl file that contains the HTML template code.
- .tcf file that further expands the creation of new pages.
- .gif file that represents the thumbnail.
Naming
The Preview thumbnail must end with .gif and the HTML template must end with .tmpl. Later, when the new page is created from that template, it may end with .htm, .html, .shtml, .asp .php, .cfm, and many more.
The templates are listed alphabetically when the new page button is pressed.
Preview Thumbnail
This New Page Template thumbnail example is named "template001.gif" and is displayed as the first template on the page. Subsequent templates might be named "template002.gif", template003.gif, etc.
Basic Template Tagging
The TMPL template itself is simply a page that users begin with when they create new pages within the OmniUpdate system. Template names must match the names of the .gif files representing them. For example, "template001.gif" must have a counterpart named "template001.tmpl". There are a few additional considerations that should be taken into account for best results.
Required
Use logical paths
If you create a new page, the page may be stored in many possible directories at different levels of your server; for that reason the image and link paths should be absolute. For instance, if your image has a src="/ox/z-includes/../images/coolnavbutton.gif", the image could wind up missing if you put it in a directory that was at a different level within your site. A correct path should look something like this:
/images/coolnavbutton.gif
Optional
Replace title with following code:
<title>Gallena University: <!--%echo var="subtitle" --></title>
Replace keyword and description tags with following code:
<meta name="keywords" content="<!--%echo var="metakey" -->">
<meta name="description" content="<!--%echo var="metadesc" -->">
Add the title tag to the template
<p><font size="+3"><!--%echo var="subtitle" --></font></p> (with formatting)
<!--%echo var="subtitle" --> (without formatting)
Create preset selective editing areas
<!-- com.omniupdate.div label="Name this text area" group="OmniUpdate group " -->
put your content in here
<!-- /com.omniupdate.div -->
Name this text area:
Do not to assign multiple areas on the same page with the same name. Choose any name, but do not use any punctuation characters.
OmniUpdate group:
This is the group that will have access to this area of the page. It is often helpful to use the default group "Everyone" for the main body area of the page, then unique groups such as "Side Navbar Editors" for the side navigation and so on. Because the group "Everyone" contains all users you'll be able to quickly assign page access to any specific sub-group without changing the group tag in the code. Remember that only people assigned access to a page can begin editing that page -- regardless of the "Group" parameter assigned to selective areas. (NOTE: user levels 9 and 10 ignore this tagging code)
Using this preset tagging will allow you to set up areas for selective editing or even include global navigation areas like footers or navbars that are duplicated throughout the site.
Advanced Template Tagging
New page templates (.tmpl files) can define variables, usually at the begining of the file, and then echo the value of these variables one or more times within the new page when it's created.
Defining Variables
Group Tag
To set editing access for a page created by a new page template:
<!-- com.omniupdate.meta group="Everyone" -->
Note: "Everyone" is a standard group available in all accounts. Any other account-specific group name may also be used.
Filename Tag
To set a default file name for new pages created by templates:
<!-- com.omniupdate.meta filename="index" -->
Extension Tag
To set a default extension to a file name for new pages created by templates:
<!-- com.omniupdate.meta group="Secondary Nav" filename="rightnavlinks" extension="inc" -->
Echoing Variables
User-Defined Echo Tags
To echo any user-defined variable as defined above, simply use the following format:
<title><!--%echo var="title" --></title>
Meta Echo Tags
To echo any of the default meta fields from a non-TCF defined new page form, use the following format:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="<!--%echo var="metakey" -->">
<meta name="description" content="<!--%echo var="metadesc"-->">
Title Echo Tag
If you want the page title to appear within the body of the page, use the following format:
<!--%echo var="title" -->
Other System-Defined Echo Tags
If you want to write a path within the same directory:
1. First, declare a variable to use as follows: <!--%set var="myvarname" directory="current" file="_section-path.html"-->
2. Second, use the new variable as follows: <!-- com.omniupdate.div label="breadcrumb-preview" group="z-nav-section-name" path="<!--%echo var="myvarname" -->" button="125" position="bottom" -->
If you want to write a path up one directory:
1. First, declare a variable to use as follows: <!--%set var="myvarname" directory="parent" file="_section-path.html"-->
2. Second, use the new variable as follows: <!-- com.omniupdate.div label="breadcrumb-preview" group="z-nav-section-name" path="<!--%echo var="myvarname" -->" button="125" position="bottom" -->