Vine Type Content Management with Standards in Mind

21 Oct 2005

Template Variables

Templates variables are the "dynamic" part of a dynamic Vine Type website. In other words, without variables, there content never changes. Template variables represent a number of different dynamic content, from the article contents and comment comments to Gravatar images and search boxes.

The vinetype.config file variables can be used in template files where applicable, as well as additional Vine Type variables. Vine Type template variables begin with $_.

That Aggravating Ampersand

Template files are XML, and XML is quite particular about the ampersand & character. Oftentimes, you will need to place an ampersand into a URL within a template file.

If you need to put an ampersand into a URL as it will likely happen, Vine Type will complain -- with the frustrating error7 "Template File is not well-formed" error message. Ampersands must be escaped in XML even within attribute values.

Example

(escape your ampersands in your template file...)
<a href="http://somewhere.com/default.aspx?blog=15&amp;post=22323">Hints &amp; Tips</a>

An alternative solution is to place $amp into the attribute value where the ampersand belongs, and add an entry $amp:&amp; into the vinetype.config file. This will keep your template well-formed, while getting an ampersand into the URL as it should be.

Alternate Example

(in template file...)
<a href="http://somewhere.com/default.aspx?blog=15$amppost=22323">Hints $amp Tips</a>

(in vinetype.config file...)
$amp:&amp;

This example shows how you can create a user variable of your own in the vinetype.config file, and reference it within the template file.

download

Visit the Download Area to test drive the standard in standards compliance.

upgrade

Add professional features to your Vine Type site by purchasing a Vine Type Pro license.

feedback

Discuss Vine Type or pose questions at the official Vine Type Forum hosted by ASP Advice.

about us

Learn more about this site and the features it is demonstrating.

© 2001-2017 vine branches — website powered by vine type