4.4. Invoking a Flavour

The flavour for a given page is specified in the extension of the file being requested. For example:

Table 4-4. Examples of request URIs

urlwhat happens
http://some.blog.org/brings up the index in the default flavour which is "html"
http://some.blog.org/index.htmlbrings up the index in the "html" flavour
http://some.blog.org/index.rssbrings up the index in the "rss" flavour (which by default is RSS 0.9.1)
http://some.blog.org/2004/05/index.joybrings up the index for May of 2004 in the "joy" flavour

Additionally, you can specify the flavour by adding a flav variable in the query-string. Examples:

Table 4-5. Specifying flavour using the querystring

uriwhat happens
http://some.blog.org/brings up the index in the default flavour which is "html"
http://some.blog.org/?flav=rssbrings up the index in the "rss" flavour
http://some.blog.org/2004/05/index?flav=joybrings up the index for May of 2004 in the "joy" flavour

You can change the default flavour from html to some other flavour in your config.py file with the default_flavour property:

Example 4-3. default_flavour variable value

py["default_flavour"] = "joy"

Doing this will set the default flavour to use when the URI the user has used doesn't specify which flavour to use. For example, if you do the above, then the following URIs will use the default flavour:

Table 4-6. Default flavour used

uriwhat happens
http://www.joe.com/cgi-bin/pyblosxom.cgi/2005/03uses the default flavour which is set to "joy"
http://www.joe.com/cgi-bin/pyblosxom.cgi/2005/03/?flav=htmluses the html flavour as specified by flav=