1 # Blosxom plugin: pagetype
2 # Author(s): Barijaona Ramaholimihaso
3 # Version: 2006-01-01blosxom2
4 # Documentation: see bottom of file or perldoc title
8 # ------------------ Config variables ---------------------
10 use vars qw($pagetype $static);
13 # ---------------------------------------------------------
15 $static = ($blosxom::static_or_dynamic eq 'static');
20 if ($blosxom::path_info_yr ne '' )
21 {$pagetype = 'chrono' ; }
22 elsif ($static && ( $blosxom::path_info =~ m!^(\d{4})!))
23 {$pagetype = 'chrono' ; }
24 elsif (($blosxom::path_info =~ /$blosxom::flavour$/) or (($blosxom::path_info =~ /$blosxom::file_extension$/) && $static))
25 {$pagetype = 'story' ; }
26 elsif ($blosxom::path_info eq "")
27 {$pagetype = 'main' ; }
29 { $pagetype = 'category';};
31 # let blosxom continue
41 Blosxom Plug-in: pagetype
45 The variable $pagetype::pagetype is to be used with interpolate_fancy.
47 You can test it in your templates to know what kind of page Blosxom is currently rendering :
49 main : the root of the blog
50 category : a category archive page
51 chrono : a chronological archive page (per year, per month, per day...)
52 story : an individual story page
60 2006-01-01blosxom2 : take into account the corrections of $path_info in recent versions of blosxom.cgi
62 2004-08-22blosxom2 : First published version
66 Barijaona Ramaholimihaso <blosxom@barijaona.com>
70 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net
72 Blosxom Plugin Docs: http://blosxom.sourceforge.net/plugins/
76 None known; please send bug reports and feedback to the Blosxom development mailing list <blosxom-devel@lists.sourceforge.net>.
80 This program is free software; you can redistribute
81 it and/or modify it under the same terms as Perl itself.