GPX Spinner  
Home
Examples
Help
Download
Links
 

How to use variables in templates

All of the GPX Spinner output is based on template files. These templates allow you to greatly customize the look and feel of your HTML pages without needing to edit the source code itself. All of the template files are found in the folder:

\GPX Spinner\templates

Templates generally contain straight HTML text. They can also contain variables and conditional statements. The GPX Spinner template parser will replace these variables with actual values when creating the output files.

For example, the state/province/country where a cache is located is specified in the template "cache.htm" as:

<% if state %>%state%<% endif %><% if not state %>%country%<% endif %>

For a cache in the United States, this might be rendered as:

California

While for a cache in Liechtenstein, this would simply be rendered as:

Liechtenstein

For more information on using conditional statements, see Using Conditional Statements in Templates.

Variables are interpolated case insensitively, and can match multiple times in a single template.

See also: List of all available variables.

 

 

Home   Examples   Help   Download   Links

GPX Spinner is Copyright © 2003-2006 by Lil Devil
The Groundspeak Geocaching Logo is a trademark of Groundspeak, Inc. Used with permission.