BASICS

ADMINISTRATION

DEVELOPMENT

SUPER ADMIN

  LAST UPDATED
12/17/2012

Examples of Templates

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 creates a total of two include files and one container page. This container page as well as new pages within this directory share the new breadcrumb and left navigation files created by this TCF.
Create

The new TCF file, template files, and thumbnail image are stored within the templates folder for this site.

Required Files

This example requires the following example files:

  1. newsection.gif -- Preview thumbnail image (displayed on the New Page Wizard).
  2. newsection.tcf -- The XML template control file.
  3. newpage.tmpl -- The template for the container page used in this TCF.
  4. z-breadcrumb.tmpl -- The template for the breadcrumb used in this TCF.
  5. z-sidenav.tmpl -- The template for the left navigation used in this TCF.

Preview Thumbnail

The preview thumbnail is a small image (approximately 150 pixels wide) with the same name as the TCF file. It provides a graphical shortcut for users to click on.

New Section

TCF File


The TCF file newsection.tcf is an XML file that instructs the system the actions to take when users click on New to create a new page.

Code Snippet

<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 &quot;Friendly Name&quot; (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>

Screen Shot of New Page Wizard

The Title Tag

 

Code Snippet Deconstructed

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 contains all the variables that are presented to the user within the New Page Wizard. In addition to the visible prompts, it can also include variables that are hidden to the user.
The variable list in the code snippet does the following:
  • Displays 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 &quot;Friendly Name&quot; (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 &quot;Friendly Name&quot; (Used in title, etc)."></variable>
</variable-list>


User Prompts

 

Template List

The template list has a list of all the templates that the TCF file creates and actions taken 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>

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 breadcrumb 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>

 


Was this page helpful?

Additional Comments:


(Include your email address if you would like a reply)

Procede to http://support.omniupdate.com/