[pmwiki-users] pagelist questions

Hans design at flutesong.fsnet.co.uk
Tue Jul 19 14:32:27 CDT 2005


Tuesday, July 19, 2005, 7:49:26 PM, Bronwyn wrote:
> If you spot what's missing, let me know.  Thanks though!

ooops, something got lost in my pasting the code. Try this:

## $FPLFunctions is a list of functions associated with fmt= options
SDVA($FPLFunctions, array(
  'sidebar' => 'FPLSideBar',
  'bygroup' => 'FPLByGroup',
  'simple'  => 'FPLSimple',
  'group'   => 'FPLGroup'));

## FPLSideBarSB provides a bullet list of pages organized by group,
## the group displayed as Header 1, for use in a SideBar
function FPLSideBar($pagename, &$matches, $opt) {
  global $FPLSideBarStartFmt, $FPLSideBarEndFmt, $FPLSideBarGFmt,
    $FPLSideBarIFmt, $FPLSideBarOpt;
  SDV($FPLSideBarStartFmt,"<ul class='fplsidebar'>");
  SDV($FPLSideBarEndFmt,'</ul>');
  SDV($FPLSideBarGFmt,"<h1><a href='\$ScriptUrl/\$Group'>\$Group</a> </h1>\n");
  SDV($FPLSideBarIFmt,"<li><a href='\$PageUrl'>\$Name</a></li>\n");
  SDVA($FPLSideBarOpt, array('readf' => 0, 'order' => 'name'));
  $matches = MakePageList($pagename, array_merge($FPLSideBarOpt, $opt));
  if (@$opt['count']) array_splice($matches, $opt['count']);
  $out = array();
  foreach($matches as $pc) {
    $pgroup = FmtPageName($FPLSideBarGFmt, $pc['pagename']);
    if ($pgroup != @$lgroup) { $out[] = $pgroup; $lgroup = $pgroup; }
    $out[] = FmtPageName($FPLSideBarIFmt, $pc['pagename']);
  }
  return FmtPageName($FPLSideBarStartFmt, $pagename) . implode('', $out) .
             FmtPageName($FPLSideBarEndFmt, $pagename);
}
# turn off group name with the next line,
# comment it if you want the group name in the list.
$FPLSideBarGFmt = "";



Best, 
~Hans                           





More information about the pmwiki-users mailing list