Workbench: Displaying Category Links in Radio UserLand


Workbench: Programming and publishing news and comment

Programming and publishing news and comment

 

Workbench.root

Workbench.viewCategories()

This script displays a list of links to each of a weblog's categories that is being rendered as HTML. Other categories are ignored.

To use the script on a Web page or a template such as #homeTemplate.txt, at the spot where the category links should appear, add this macro:

<%Workbench.viewCategories()%>

Here's the output of that macro for my weblog:

Jargon
Java
Manila Tips
Microsoft Bob
Movable Type
OPML Link Publisher
Politics
Radio Userland
RSS 2.0
Salon Blogs
Sports

The macro displays each category link separated by BR tags. It can be called with three parameters, in this order:

  1. class, the name of the CSS class for each hyperlink (default: no class)
  2. preText, the HTML and/or text to display before each hyperlink (default: none)
  3. postText, the HTML and/or text to display after each hyperlink (default: <BR>)

An example:

<%Workbench.viewCategories("sidebarlink", "<li>", "<br>")%>

Output of that macro for my weblog:

  • Jargon
  • Java
  • Manila Tips
  • Microsoft Bob
  • Movable Type
  • OPML Link Publisher
  • Politics
  • Radio Userland
  • RSS 2.0
  • Salon Blogs
  • Sports

    Home

    comments

  • Copyright 2004 Rogers Cadenhead. Last updated 8/20/2004; 11:16:09 AM.