Metadata

Metadata means "information about information."

Awasu brings news to you via your channels but it also tracks a lot of additional information about it all e.g. when a feed item was published, who wrote it, if it has any enclosures, etc.

This metadata can be inserted in templates using the {%CHANNEL-METADATA%} and {%ITEM-METADATA%} parameters.

 

Metadata tree Metadata is stored in a tree-like hierarchy, so a channel's metadata might look something like the diagram on the right.

Each piece of channel metadata is accessed using the {%CHANNEL-METADATA%} parameter, so if you were generating an HTML page, you could create an email link for the author like this:

<a href="mailto:{%CHANNEL-METADATA% author/email}">
    {%CHANNEL-METADATA% author}
</a>
Warning
This example contains some potential problems which are discussed here, together with how to work around them.

 

Entries in the metadata hierarchy are either metadata values (e.g. Name or URL in the example above) or metadata groups (e.g. Link or Author).

Metadata groups have no actual value themselves but if they are used in template parameters (e.g. {%CHANNEL-METADATA% author}) then Awasu will check the child metadata values and choose the most appropriate one.

So, in the example above, Awasu will generate a mailto: link for the author's email address, using the author's name, email address or URL (in that order of preference) as the display text.

 

Hint
The {%ITEM-METADATA-DUMP%} and {%CHANNEL-METADATA-DUMP%} parameters will output a formatted dump of the current item or channel's metadata and are very useful to see what metadata is available when writing your own templates. They work best when wrapped in <pre> tags, to preserve the formatting.