blosxom :: the zen of blogging

about

  • home/about
  • features
  • colophon
  • news
  • mailing list
  • donate


  • documentation for users

  • overview
  • install
  • configure
  • blog
  • view
  • flavour
  • syndicate
  • plugins
  • plugin registry
  • static
  • faq
  • use cases*
  • documentation for developers

  • overview
  • plugins
  • downloads

  • mac
  • windows*
  • everyone

  • license
  • contributed*
  • powered by

    Amazon Honor System Click Here to Pay Learn More
    How do I How do I build a section like Rael's plugin directory or FAQ?

    The first thing you need to know when building a section like the plugin directory is that it requires careful use of several plugins and some knowledge of blosxom flavours.

    You will need a copy of the following plugins: 'config', 'crop_path' and 'sort_by_path'. Both 'crop_path' and 'sort_by_path' should be turned off by putting a '_' at the end of their name. Check the perldoc at the end of each plugin for details on how to use them and make sure you have set all the relevent variables at the start. (To do this go to the command line and type 'perldoc plugin_name).

    Next you will need to build you directory structure. You will need a parent directory and a child directory for each category on your page. So, for example, Rael's plugin directory would have a parent directory called 'plugins' and child directories 'archives', 'author', 'browser', calendar and so on.

    Now you will need a flavour to display what you need. Copy all the flavours from your default style into the parent directory and change the suffix on them all to something else. I used '.w' as my suffix. You need to do this so that the default flavour will be used to display the 'story' on your front page. The only flavour files you will need to change are the 'date.w' and 'story.w' files. 'date.w' should display only the path and provide a link to go to the category. Mine is :-

    <span class="category">
    <p style="margin-left: 0px;">
    <a href="$url$path">$crop_path::path</a>
    </p>
    </span>
    

    My 'story.w' is :-
    <code>
    <span class="category-item">
    <p style="margin-left: 12px;">
    <b>$title</b>
    $body
    <a href="$url$path/$fn.writeback" class="orangelink">
    more</a>
    
    This makes the title bold and places the rest of the story immediately following and immediately following that a link to the writeback page. (You can find my stylesheet here.)

    Our final step is to write our config file. Here's mine :-

    $blosxom::plugins{'sort_by_path'} = 1;
    $blosxom::flavour = "w";
    $blosxom::plugins{'crop_path'} = 1;
    $blosxom::num_entries = 999;
    
    This turns on 'sort_by_path', then sets the flavour to 'w', turns on 'crop_path' so that our categories only have the child name and finally sets num_entries so large we will never hit it. This config file should be put in the parent directory and each of the child directories.

    You should now have a working page sorted by categories.

    Author: Tony Williams
    Category: /faq/general
    Date: 2003-07-27