Thu, 07 Dec 2006

Invoking a Flavour

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

Table - Examples of request URIs

url what happens
http://some.blog.org/ brings up the index in the default flavour which is "html"
http://some.blog.org/index.html brings up the index in the "html" flavour
http://some.blog.org/index.rss brings up the index in the "rss" flavour (which by default is RSS 0.9.1)
http://some.blog.org/2004/05/index.joy brings 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 - Specifying flavour using the querystring

uri what happens
http://some.blog.org/ brings up the index in the default flavour which is "html"
http://some.blog.org/?flav=rss brings up the index in the "rss" flavour
http://some.blog.org/2004/05/index?flav=joy brings 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 - 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 - Default flavour used

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

Example Flavours

  • Show gray flavour
  • Show green flavour

[23:37] | [] | #-permalink-#