## RSS Bandit Templates Readme

##

Last modified Feb. 03, 2004
www.rssbandit.org

## Preface

This folder contains the RSS Bandit Item formatting samples. If you start experimenting with these, ensure you use your own: copy/rename the interesting one, and change it to apply your needs.

### Table of contents

- Preface
- Basics
- Elements
- Best practice
- Localization
- Get involved

### Basics

You should be familiar with XSLT to be able to get it work. The input of each XSLT stylesheet is a XML document fragment describing an RSS item. The root element will be a `newspaper` element which will have contain one or more RSS 2.0 `channel` elements as children. The subelements of the `channel` element depend on the information provided by a particular RSS feed. This format is identical to that emitted by FeedDemon's Newspaper Styles which means all FeedDemon styles are valid RSS Bandit styles and vice versa.

### Elements

The required base elements of the channel element are provided for custom formatting.

Besides the subelements of the `item` element specified in the RSS 2.0 spec there may also be elements from other namespaces which correspond to various RSS 2.0 modules. Brief descriptions of such modules and elements are provided in the table below.

Module Name | Description
Dublin Core | The Dublin Core Metadata Element Set provides some standard metadata elements for describing published content on the web.
Content | A module for the actual content of websites, in multiple formats. The most commonly used element from this module is `content:encoded`
Slash | The Slash RSS 1.0 module augments the RSS core and Dublin Core module's metadata with channel and item-level elements specific to SlashCode-based sites
CommentAPI | Describes the `wfw:comment` element which is used to provide the location of the CommentAPI endpoint to aggregator software.
XHTML in RSS 2.0 | Specifies the use of the `xhtml:body` element to provide content in an RSS feed.
Easy News Topics | ENT is provides a mechanism for describing how topic information can be introduced into an RSS 2.0 news feed

### Best practice

At first you have to enable the usage of a custom formatter within the options dialog: select the menu File|Options... and then the tab named "Display". Ensure the checkbox "Use a custom formatter" is checked. Then play with the existing formatter stylesheets.

Your stylesheet should produce valid (X)HTML. If you want to use CSS for visual effects, ensure to use it in the embedded form to keep it with your formatting templates. Do not forget to insert an HTML `base` element within the HTML HEAD section to get relative links of images resolved by the browser control! The existing stylesheets can be used as examples as to how to generate this correctly for the different views.

There is support to split the css stylesheet (or images) to separate file(s). If your formatter stylesheet want to use that, you have to add these two prameters on the root level (child of<xsl:stylesheet>):

      <xsl:param name='AppStartupPath'/>
      <xsl:param name='AppUserDataPath'/>

They are filled by RssBandit to reflect:

- AppStartupPath: the current path to the executable RssBandit.exe (C:\Program Files\RssBandit)
- AppUserDataPath: the path to the Application Data folder
  (usually C:\Documents and Settings\\Application Data\RssBandit)

Now you can code a line like this:

    <link rel="stylesheet" type="text/css" href="{$AppStartupPath}/templates/my-new.css" />

pointing to a css file located at C:\Program Files\RssBandit\templates.

### Localization

This feature is only support in RSS Bandit versions 1.3.0.44 and higher! To get some common localized text to display, you have to add an additional namespace to the xsl:stylesheet root element and call the appropriate function on it:

    <xsl:stylesheet ...
      xmlns:localized='urn:localization-extension'
      ...>
      ...
      <img alt="{localized:ToggleReadStateText()}" ... />
      ...
      <xsl:value-of disable-output-escaping='yes'
        select='localized:ItemPublisherText()' />

The following functions are available to return a localized version of a common text:

Function Name | Description

    ItemPublisherText()

Gets the item publisher text (english culture: "Publisher")

    ItemAuthorText()

Gets the item author text (english culture: "Author")

    ItemDateText()

Gets the item post date text (english culture: "posted at")

    ItemEnclosureText()

Gets the item enclosure text (english culture: "Enclosure")

    ToggleFlagStateText()

Gets the item toggle flag stae text (english culture: "Set or clear flag")

    ToggleReadStateText()

Gets the item toggle read state text (english culture: "Mark read or unread")

    ToggleWatchStateText()

Gets the item toggle watch state text (english culture: "Watch or stop watching comments")

    ToggleShareStateText()

Gets the item toggle share state text (english culture: "Share or unshare item in Google Reader")

    ToggleClipStateText()

Gets the item toggle clip state text (english culture: "Add or remove item from clippings folder in NewsGator Online")

    RelatedLinksText()

Gets the text for the link to Technorati for an item that shows up in the search results template (english culture: "Related Links")

### Get involved

Feel free to join the Developer community at dev.rssbandit.org by providing patches, suggestions or error reporting!
RSS Bandit users may visit our forum at www.rssbandit.org/forum.