[Home]WikiSuggestions/DoubleWikiPrintingKludge

UseModWiki | WikiSuggestions | RecentChanges | Preferences

The double wiki printing kludge is a poormans way to a print button. I whipped it up a couple of nights ago to get a printable page button like z-wiki

If you want to see one in action checkout http://www.edu-coop.org/educoopwiki/wiki.pl.

First make a a copy or your wiki.pl file caled waki.pl (or whatever)and put it in that same directory as wiki.pl.

In the waki.pl file set the $EmbedWiki variable to 1. This wiki will not have headers and footers.

In the wiki.pl file, add the following code

sub GetPrintLink? {

my ($page) = @_;

 return "<a href=\"http://www.edu-coop.org/educoopwiki/waki.pl?$page\">PrintablePage?</a>";

}

after this line of code

sub GetPrefsLink? {

  return &ScriptLink("action=editprefs", T('Preferences'));

}

then change

$bartext .= " | " . &GetPageLink($RCName);

  $bartext .= " | " . &GetPrefsLink?();

to

$bartext .= " | " . &GetPageLink($RCName);

  $bartext .= " | " . &GetPrefsLink?();

  $bartext .= " | " . &GetPrintLink?($id);

in the GetGotoBar sub routine.

You should now have a printable page button on the top goto bar.


Here is what I think is happening. The getgotobar sub routine makes a button on the goto bar by calling $getprintlink which generates a link to the waki.pl code with the page name of the curent page. When ou click on the link, waki.pl returns that page you are on (from the wiki page database) without the headers and footers .

Again, check the link to edu-coop to see this in action.

Of course if I actually knew perl I waould have written this right into the wiki.pl code.

FYI


UseModWiki | WikiSuggestions | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited March 24, 2007 10:11 pm by indushost2.dedicatedplace.com (diff)
Search: