Examples
Contents
This advanced TCF example creates three files and a new directory. It prompts the user for only a folder name and a section or friendly name for this new folder. This particular TCF will create a total of two include files and one container page. This container page as well as new pages within this directory will share the new breadcrumb and left navigation files created by this TCF.
Required files for this example:
The new TCF file is stored, as well as the template files and thumbnail image, within the templates folder for this site.
- newsection.gif - Preview Thumbnail image (what the users see and click on in the new page screen.)
- newsection.tcf - The XML Template Control File.
- newpage.tmpl - The template for the container page used in this TCF.
- z-breadcrumb.tmpl - The template for the breadcrumb used in this TCF.
- z-sidenav.tmpl - The template for the left navigation used in this TCF.
Preview Thumbnail :
A small image (approximately 150 pixels wide), with the same name as the TCF file, provides a graphical shortcut for users to select your Template Control File or TCF.
TCF File:
The TCF File "newsection.tcf" is simply an XML file instructs the OmniUpdate system actions to take when users click on the create new page button.
<title>New Folder With Web Pages - New Section</title>
<variable-list>
<variable name="dirname" prompt="Actual Folder Name: (no spaces or punctuation!)" alt="DO NOT USE SPACES OR PUNCTUATION! This is the actual name of the folder you are creating."></variable>
<variable name="subtitle" prompt="Section Title" alt="Give your new
section a "Friendly Name" (Used in title, etc)."></variable>
</variable-list>
<template-list>
<template prompt-prefix="Home Page" filename="index" extension="shtml"
display-filename="no" overwrite="no" display-overwrite="yes"
group="everyone" display-destination="no" destination="{dirname}"
force-destination="yes" preferred-redirect="yes">newpage.tmpl</template>
<template prompt-prefix="Side Navigation" filename="z-leftnavigation"
extension="html" display-filename="no" overwrite="no"
display-overwrite="yes" group="z-sidenaveditors" display-group="no"
display-destination="no" destination="{dirname}" publish="yes"
force-destination="yes" toolbar="leftnavigation">z-leftnavigation.tmpl</template>
<template prompt-prefix="Bread Crumb" filename="z-breadcrumb"
extension="html" display-filename="no" overwrite="no"
display-overwrite="yes" group="z-breadcrumbeditors" display-group="no"
display-destination="no" destination="{dirname}" publish="yes"
force-destination="yes" toolbar="leftnavigation">z-breadcrumb.tmpl</template>
</template-list>
Template Title:
The title tag appears above the user prompt area in the new page wizard.
<title>New Folder With Web Pages - New Section</title>
Variable List :
The variable list within the TCF file contains all the variables that are presented to the user within the New Page creation screen. This can include variables that are hidden to the user as well as visible prompts.
This variable list:
- Displays to the user the instruction text "Actual Folder Name" which the TCF will use to create a new directory.
- Prompts the user for the text field "dirname" which will be used in the template list for the actual name of the new folder.
- Displays alternate text for the folder name after the text field which says "DO NOT USE SPACES OR PUNCTUATION! This is the actual name of the folder you are creating."
- Displays to the user instruction text "Section Title" which the TCF will use in several places for this new section's name.
- Prompts the user for the text field "subtitle" which will be used in the template list for the section name.
- Displays alternate text for the section name after the text field which says "Give your new section a "Friendly Name" (Used in the title, etc." Note that the quotes must be in html, using the actual quote character will end the alt text prematurely.
<variable-list>
<variable name="dirname" prompt="Actual Folder Name: (no spaces or punctuation!)" alt="DO NOT USE SPACES OR PUNCTUATION! This is the actual name of the folder you are creating."></variable>
<variable name="subtitle" prompt="Section Title" alt="Give your new
section a "Friendly Name" (Used in title, etc)."></variable>
</variable-list>
Template List:
The template list has a list of all the templates that the TCF file creates and actions take on them.
- Create the Home Page using the file "newpage.tmpl".
- Name the file "index.shtml" .
- The redirect will open this page in the editor after the pages are created.
- Display an overwrite checkbox, otherwise this TCF would not be able to overwrite an existing index.shtml.
- Force destination will create the new folder.
- Create a Side Navigation using the file "z-navigation.tmpl"
- Name the file "z-sidenavigation.html"
- This file also allows an overwrite.
- The page is automatically assigned to the toolbar group "leftnavigation".
- The page is automatically assigned to the editing "z-sidenaveditors".
- Create a breadcrumb file using the template "z-breadcrumb.tmpl".
- Name the file "z-breadcrumb.html".
- This file also allows an overwrite.
- The page is automatically assigned to the toolbar group "leftnavigation".
- The page is automatically assigned to the editing group "z-breadcrumbeditors".
<template-list>
<template prompt-prefix="Home Page" filename="index" extension="shtml"
display-filename="no" overwrite="no" display-overwrite="yes"
group="everyone" display-destination="no" destination="{dirname}"
force-destination="yes" preferred-redirect="yes">newpage.tmpl</template>
<template prompt-prefix="Side Navigation" filename="z-leftnavigation"
extension="html" display-filename="no" overwrite="no"
display-overwrite="yes" group="z-sidenaveditors" display-group="no"
display-destination="no" destination="{dirname}" publish="yes"
force-destination="yes" toolbar="leftnavigation">z-leftnavigation.tmpl</template>
<template prompt-prefix="Bread Crumb" filename="z-breadcrumb"
extension="html" display-filename="no" overwrite="no"
display-overwrite="yes" group="z-breadcrumbeditors" display-group="no"
display-destination="no" destination="{dirname}" publish="yes"
force-destination="yes" toolbar="leftnavigation">z-breadcrumb.tmpl</template>
</template-list>
Code Added to the "newpage.tmpl" Template:
The home page for the new directory requires some code to create paths to the new directory about to be created, and pre-fill some of the text on the page, based on the name of the new section.
This code will:
- Put the section title tag in the home page for this new directory. Text can be pre-filled before and after the subtitle variable.
- Put the correct path to the side navigation in both the omniupdate tag and the actual include tag.
- Put the correct path to the bread crumb in both the omniupdate tag and the actual include tag.
- Put the section title in the <H1> tag within the content of the page.
<title><!--%echo var="subtitle" --></title>
<!-- com.omniupdate.div label="SideNavigation" button="764" group="z-sidenaveditors" path="<!--%echo var="directory" -->/z-leftnavigation.html" break="break" -->
<!--#include virtual="<!--%echo var="directory" -->/z-leftnavigation.html" -->
<!-- /com.omniupdate.div -->
<!-- com.omniupdate.div label="Breadcrumb" path="<!--%echo var="directory" -->/z-breadcrumb.html" button="671" group="z-breadcrumbeditors" -->
<!--#include virtual="<!--%echo var="directory" -->/z-breadcrumb.html" -->
<!-- /com.omniupdate.div -->
<h1><!--%echo var="subtitle" --></h1>
Code Added to the "z-breadcrumb.tmpl" Template:
The breadcrumb include file requires code to write in the correct paths to the home page for the new directory about to be created.
This code will:
- Recursively work its way up to the home page creating a "breadcrumb" with all the directories, as many levels as it is deep.
- The breadcrumb text will be pre-populated with the section name.
- The hyperlink to the section name will be pre-populated with the correct path.
<!--#include file="../z-breadcrumb.html" -->
<!-- com.omniupdate.div label="Breadcrumb" group="Everyone" button="550" position="top" -->
<!-- com.omniupdate.editor csspath="/z-omniupdate/css/breadcrumb.css" cssmenu="/z-omniupdate/css/breadcrumb.txt" width="890" div="#OUPreview" -->
<a href="<!--%echo var="directory" -->/index.shtml"><!--%echo var="subtitle" --></a><!-- /com.omniupdate.div --> /
Code Added to the "z-leftnavigation.tmpl" Template:
The left navigation include requires code to write in the correct paths to the home page for the new directory that is about to be created.
This code will:
- Remember to put the CSS tag on the first line of include files.
- The side navigation home page for this directory link will be pre-populated with the section name.
- The hyperlink to the section name will be pre-populated with the correct path.
<!-- com.omniupdate.editor csspath="/z-omniupdate/css/edit-sidenav.css" cssmenu="/z-omniupdate/css/edit-sidenav.txt" width="800" -->
<table width="148" height="25" border="0" cellpadding="0" cellspacing="0" class="sectionheader">
<tr>
<td><a href="<!--%echo var="directory" -->/index.shtml"><!--%echo var="subtitle" --></a></td>
</tr>
</table>
<table width="148" border="0" cellpadding="0" cellspacing="0" class="sublink">
<tr>
<td>sampletext</td>
</tr>
</table>