Tag Types

There are 3 different types of tags; Basic Tags, Hypertext tags, and Date tags. The latter two types can be optionally configured with attributes.

Basic Tags

Basic tags take no attributes, and are simply replaced with plain text weblog data.

 
Date Tags

Date Tags are replaced with date related data and can take the following optinal attributes:

Example: <$CurrentDate$ format="MM/dd/yy"$>

The tag above will be replaced with the current date formatted to display the month, day, and year. E.g 05/15/04.

The format attribute can take any valid Java date format pattern.

In addition you can specify the value "RFC822" for the format attribute. This is useful if you need to, for instance, supply RFC822 date formats for the RSS feed. If the value RFC822 is given, the the locale attributes, if specified, are ignored.

The following examples show how date and time format patterns are interpreted in the U.S. locale. The given date and time are 2001-07-04 12:08:56 local time in the U.S. Pacific time zone.

Date and Time Pattern Result

"yyyy.MM.dd G 'at' HH:mm:ss z"

2001.07.04 AD at 12:08:56 PDT

"EEE, MMM d, ''yy"

Wed, Jul 4, '01

"h:mm a"

12:08 PM

"hh 'o''clock' a, zzzz"

12 o'clock PM, Pacific Daylight Time

"K:mm a, z"

0:08 PM, PDT

"yyyyy.MMMMM.dd GGG hh:mm aaa"

02001.July.04 AD 12:08 PM

"EEE, d MMM yyyy HH:mm:ss Z"

Wed, 4 Jul 2001 12:08:56 -0700

"yyMMddHHmmssZ"

010704120856-0700

The default, no attribute, format is: dd/MM/yy h:mm

Hypertext Tags

Hypertext Tags are replaced with data that likely contains HTML. Hypertext Tags can take the following attributes…

Let’s say we didn’t want any HTML in the weblog’s description, and that we want to limit the maximum number of words in the description to 10. We’d use the following tag and attributes…

<$BlogDescription strip_html="1" limit_lenth="1" words="10"$>

A default, no attribute, hypertext tag does not encode HTM, does not strip html, and does not limit the length.

Find/Replace

The find and replace attributes work together to find and replace text contained within a tag.

find="regex"

This finds all occurrences as specified by the regular expression. For the find attribute to do anything, you must also supply a replacement value.

replace="text to replace the regex with"

For example, let's suppose that we want to change all occurrences of the word "Robert" in our entries to "Bob." The <$EntryBody$> tag would look like...

<$EntryBody find="Robert" replace="Bob"$>

Thus, any occurrence of "Robert" in the entry body is automatically changed to "Bob" when the weblog pages are generated.

Since the find attribute takes regular expressions, much more complex find/replacements can be done. As an example, let's say we want to strip all image tags from the entries. We'd use a tag such as...

<$EntryBody find="\<img\s.*?\>" replace=""$>

In the above example the attribute replace="" simply replaces the image tags with nothing.

One caveat to be aware of when using find and replace is when either value contains the quote character ". In this case, replace the " with the quote entity (&quot;). For instance, if we want to find the string 'Hello, World!' and change it to Goodbye, "cruel" World! we'd use the tag...

<$EntryBody find="Hello\, World\!" replace="Goodbye\, &quot;cruel&quot; World\!"$>