[Home]WikiPatches/TwoColumnIndex

UseModWiki | WikiPatches | RecentChanges | Preferences

When the number of pages grows large, a single-column will be inconvenient. To save a little space, I modified the PrintPageList? subroutine:


sub PrintPageList {
  my $pagename;
  print "<h3>", Ts('%s pages found...', ($#_ + 1)), "</h3>\n";

  my $idxsize = @_;
  my $halfcount = $idxsize/2; 
  my $idxtableflag=0;
  my $idxcounter=0;
  if($halfcount > 30) { $idxtableflag=1; 
  	print "<table style=\"font-size:12px\"><tr><td WIDTH=\"48\%\">"; }

  foreach $pagename (@_) {

    print "* ";  

    print ".... "  if ($pagename =~ m|/|);
    print &GetPageLink($pagename), "<br>\n";

    if($idxtableflag) { $idxcounter++; 
    	if(($idxcounter == $halfcount) || 
    	  (($idxcounter > $halfcount) && ($idxcounter < $halfcount+1)) )
    	{ print "</td>\n<td WIDTH=\"4\%\">  </td><td WIDTH=\"48\%\">"; }
    	
    	}
	}
    
  if($idxtableflag) { print "</td></tr></table>"; }  
  print "<p>\n";
}

MarkoFromOttawa?


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 22, 2009 2:07 pm by Juanmamp (diff)
Search: