[pmwiki-users] List of Categories in use

Mikael Nilsson mini at nada.kth.se
Mon Dec 12 11:18:19 CST 2005


mån 2005-12-12 klockan 11:25 -0500 skrev Martin Fick:
> You should look at the PageListTemplates recipe.

Cool!

Ok, I give up, pmwiki+extensions has it all. :-)

This would be useful for some of the blog-related things we're talking
about.

/Mikael

> 
> -Martin
> 
> On Mon, Dec 12, 2005 at 11:19:29AM +0100, Mikael Nilsson wrote:
> > s?n 2005-12-11 klockan 22:02 -0600 skrev Patrick R. Michaud:
> > > > Ooh!  This might play into a feature I've been wanting for some time! 
> > > > It's not urgent, but it's a very wiki sort of feature.  Instiki has
> > > > AllPages, a super-sitemap which lists not only existing pages, but
> > > > *also* orphaned pages and wanted pages (ones that don't exist, but
> > > > ought to).
> > > 
> > > I can come up with a couple of places where this would be quite useful.
> > > Any suggestions as to what the option to (:pagelist:) ought to be
> > > named for this (i.e., fill in the '???' below):
> > > 
> > >     (:pagelist ???=missing:)    # wanted pages
> > >     (:pagelist ???=orphans:)    # pages w/o references
> > 
> > How about just special=missing?
> > 
> > While on the subject of pagelists, I've come across a number of
> > situations where I've wanted to tailor the pagelist display. Today,
> > there are essentially two approaches (correct me if I'm wrong):
> > 
> > 1. Use fmt=simple, and modify the $FPLSimpleIFmt variable (and related
> > variables).
> > 2. Create a new formatting function, add it to $FPLFunctions, etc.
> > 
> > Now, the problem with 2. is that it is much too complicated for a
> > pagelist that occurs on a single page. The problem with 1. is that you
> > can only have one format site-wide.
> > 
> > Now, I'd like to propose a third variant: (:pagelist fmt=custom
> > style=myown ... :) (stupid syntax example).
> > 
> > This would essentially be: 
> > 
> > function FPLCustom($pagename, &$matches, $opt) {
> >   global $FPLCustomStartFmtA, $FPLCustomIFmtA, $FPLCustomEndFmtA, $FPLCustomOptA;
> >   SDV($FPLCustomStartFmtA['default'], "<ul class='fplcustom'>");
> >   SDV($FPLCustomEndFmtA['default'], "</ul>");
> >   SDV($FPLCustomIFmtA['default'], "<li><a href='\$PageUrl'>\$FullName</a></li>");
> >   SDVA($FPLCustomOptA['default'], array('readf' => 0));
> > 
> >   $customrule = (@$opt['style']) ? $opt['style'] : 'default';
> >   $customopt = (@$FPLCustomOptA[$customrule]) ? $FPLCustomOptA[$customrule] : $FPLCustomOptA['default'];
> >   $customstart = (@$FPLCustomStartFmtA[$customrule]) ? $FPLCustomStartFmtA[$customrule] : $FPLCustomStartFmtA['default'];
> >   $customend = (@$FPLCustomEndFmtA[$customrule]) ? $FPLCustomEndFmtA[$customrule] : $FPLCustomEndFmtA['default'];
> >   $customi = (@$FPLCustomIFmtA[$customrule]) ? $FPLCustomIFmtA[$customrule] : $FPLCustomIFmtA['default'];
> > 
> >   $topt['order'] = (@$opt['trail']) ? '' : 'name';
> >   $matches = MakePageList($pagename,
> >       array_merge($topt, (array)$customopt, $opt));
> >   if (@$opt['count']) array_splice($matches, $opt['count']);
> >   $out = array();
> >   foreach($matches as $pc)
> >       $out[] = FmtPageName($customi, $pc['pagename']);
> >   return FmtPageName($customstart, $pagename) . implode('', $out) .
> >       FmtPageName($customend, $pagename);
> > }
> > 
> > 
> > 
> > $FPLFunctions['custom'] = 'FPLCustom';
> > 
> > 
> > And in config.php, for an ordered list:
> > 
> > $FPLCustomStartFmtA['myown'] = "<ol class='myown'>";
> > $FPLCustomEndFmtA['myown'] = "</ol>";
> > 
> > and in a wiki page:
> > 
> > (:pagelist fmt=custom style=myown group=Main:)
> > 
> > It works! but I'm unsure about all the details... It's a hack. 
> > 
> > What do you think?
> > 
> > /Mikael
> > 
> > -- 
> > Plus ?a change, plus c'est la m?me chose
> > 
> > 
> > _______________________________________________
> > pmwiki-users mailing list
> > pmwiki-users at pmichaud.com
> > http://host.pmichaud.com/mailman/listinfo/pmwiki-users
> 
-- 
Plus ça change, plus c'est la même chose





More information about the pmwiki-users mailing list