Categories Plugin 0+4i
Categories has been updated.
User-visible Interesting Changes, in rough order by interestingness:
- new $indent template variable, which is the contents of the flavour file 'indent', repeated N times, where N is the depth of the current category
- new template variable "$prettydir", is the name of the category with spaces added to CamelCaps and instead of underlines in underlined_names.
- The top-level directory is now called "Root" by default, not "/", and it's configurable
- uses the built-in templating system, including any template plugin that's installed
- variables in templates can be interpolated with ${name} as well as $name
- cached layouts are keyed based on flavour, so if you have template files that vary by flavour it will actually work now
- cache is only enabled if the available Storable supports lock_retrieve
- the cache is flushed every time a story is added, not every time the timestamp of the latest file changes; if caching is enabled, the category list (usually) now shows all the categories even if a filtering plugin (such as a search system) has reduced the number of visible files.
- the $story_count_commulative configuration variable is now spelt $story_count_cumulative, to match the actual english language. Attempts to get enlish to change to match the plugin were unsuccessful.
- requires Blosxom
2.0rc12.0rc2 or newer - the default templates are in the 'error' flavour rather than 'html', so they're used for any flavours that don't override them (the same effect was achieved a different way in 0+4i)
Thanks to:
- Jason Hoffman, prodding me into XHTML validation
- Robert Hahn, for the directory-name prettification
- Colin Eric Johnson, for an HTML validation note
- Earle Martin, HTML validation note
Things I'd like to be able to do, but can't reasonably without Blosxom changes:
- use the built-in interpolation system, including any interpolate plugin that's installed
To install:
- download and unzip the plugin.
- Copy it to your plugins directory. Make sure it's world-readable.
- Modify a
headorfootfile to include$categories::categoriesor$categories::breadcrumbs - Try it out — load your blog in your browser. If you see a category tree, great!
- Look at your error log. Verify you have an 'enabled' line.
- If you're wanting to verify caching is working, load the page again, and now look for an error log line "calendar debug 1: Using cached state"
- Once you're satisfied it's working, edit the
$debug_levelconfiguration variable to0. There are a couple other configuration variables you may wish to change, too. - Drop me a note to let me know you're using it; if you're having problems, let me know and I might be able to help. If everything's working okay, please let me know that, too.
Molelog is running this with some customized templates.
categories.breadcrumb_between_child.html:
|​
categories.head.html:
<form name="cat" method="get" action="$url">
<!-- XXX any way to do this w/o js? -->
<script type="text/javascript">
function gotocat() {
location = document.cat.cat.options[document.cat.cat.selectedIndex].value;
}
</script>
<select name="cat" onchange="gotocat()">
categories.indent.html:
categories.dir_head.html:
<option value="$url/index.html"> $indent$prettydir / </option>
categories.this_dir_head.html:
<option selected value="$url/index.$blosxom::flavour"> $indent$prettydir / </option>
categories.foot.html:
</select></form>
categories.dir_foot.html, categories.subtree_head.html, categories.subtree_foot.html, categories.this_dir_head.html, and categories.this_dir_foot.html are all empty.
2003-03-25 15:33:00 | Comments (9) | TrackBack (0) | Computers::Internet::Web::Blosxom::Plugins::Categories
aufrank
todd—
any chance that categories could notice the files/directories in a .exclude file? ideally, it would not report them, and would not add their story counts to the total for the whole tree. if this would be easier to do with the cvsignore plugin, that’d work too.
thanks,
/au
2003-07-14 11:07:00