Microformat Templates

Introduction

The Microformats page identifies a variety of formats for various types of data so that Maprosoft can present the data in an optimized manner. However, sometimes it is not feasible for data to be formatted this way. When the source data is formatted as a table of fields and values, microformat templates can be used to bind the fields from the source data to the parts of the microformats.

Creating Microformat Templates

Microformat templates are easy to create because they are simple snippets of text formatted in a very similar way to the microformats they bind data to. Putting this another way, each microformat template is identical to a microformat, however, instead of embedding values within the text, you embed the names of your fields containing the values. They are created using the Microformats control panel. Each microformat template is associated with a single feature type.

Note that field names are always enclosed in square brackets.

Address Microformat Template Example

This example shows how build address information.


<address>
	<streetNum>
		[street_number]
	</streetNum>
	<streetName>
		[street_name]
	</streetName>
	<suburbName>
		[suburb_name]
	</suburbName>
	<state>
		
	</state>
	<postcode>
		
	</postcode>
	<country>
		
	</country>
</address>

This microformat template will associate data from fields street_number, street_name and suburb_name with the streetNum, streetName and suburbName parts of the address microformat.

HTML Microformat Template Example

This example shows how build content formatted as HTML.


<html-content>
	<header>
		Street Cleaning
	</header>
	<body>
		<![CDATA[
			See <a href="[web-url]">[web-url]</a> for more info.
		
		]]>
	</body>
</html-content>

This microformat template will create some HTML containing a link to a web site location identified by web-url.

Key/Value Pairs Microformat Template Example

The key value pairs microformat can be used to format simple key/value data.


<keyValuePairs>
	<title>
		Size and Color
	</title>
	<keyValuePair key="Color" value="[primary_color]">
	</keyValuePair>
	<keyValuePair key="Size" value="[size]">
	</keyValuePair>
</keyValuePairs>

This microformat template will result in data identified by the fields primary_color and size being presented such that it is labelled Color and Size respectively. Also, this information will be presented in a section titled Size and Color.

Multiple Microformat Templates for a Single Feature Type

Multiple microformat templates can be defined for a single feature type. For example, a spatial data source may contain information about libraries including its name, address, contact details and the hours it is open. To map source data fields containing this information, define microformat templates based on the Title, Address, Contact Details and Open Hours microformats respectively.

Using Microformat Templates to Hide Data

Microformat templates can be used to hide data that perhaps is unecessary to expose to users. For example, lets say some suburbs data contains various fields including its abbreviation used internally and the area of the suburb. The abbreviation and area are probably not of interest to most users so the hiddenKeyValuePairs microformat can be used to hide them. If the abbreviation and area fields are called Abbreviation and Area_Sq_M, then the following microformat template would hide the abbreviation and area information from users:


<hiddenKeyValuePairs>
	<keyValuePair key="Abbreviation" value="[Abbreviation]"/>
	<keyValuePair key="Area Sq M" value="[Area_Sq_M]"/>
</hiddenKeyValuePairs>
	

Note: after adding/editing any microformat template, the relevant data needs to be re-imported before the changes will become effective (hidden in the above example).