• View

  • Edit

  • History

  • Attach

  • Print

Monobook Skin

<< Marinee | Skins | Maguila >> (test page | validate)

Summary: Makes PmWiki look like MediaWiki/Wikipedia
Version: 20070125
Status: Stable
Prerequisites: pmwiki-2.1
Maintainer: Dfaure
Categories: Skins
Download: monobook.zip

About

This skin is massively inspired from MediaWiki default skin (also originally named monobook).

MediaWiki is the software used for Wikipedia and the other Wikimedia Foundation websites.

Installation

To use the Monobook skin for your own Wiki, just download monobook.zip, extract it into /path/to/pmwiki/pub/skins/ and add the following code to your local configuration file:

 # Specifies the name of the template file
 # to be used to generate pages.
 $Skin = 'monobook';

Features

The skin current features are:

  • Full CSS driven (no tables),
  • Wiki actions as notebook tabs,
  • Zoom support (fixed size fonts used only for Wiki actions),
  • Smooth handling of (:noheader:), (:nofooter:) and (:notitle:) directives,
  • Extra directives (:noleft:) and (:notabs:) available to hide unwanted sections
  • An extra SideBar bottom block using {$Group}.SideNote or Site.SideNote pages,
  • Developed and tested under IE6/7 and Firefox. Reported to work with other browsers like Epiphany, Konqueror and Opera (7.54).
Note
The original layout is supposed to handle a 135x135 pixels logo. This explains why the PmWiki logo looks a bit alone in its corner.

Technical hints (advanced user/admin.)

Notebook tabs customization

The skin uses the list of action links stored into {$Group}.PageActions or Site.PageActions pages to generate the notebook tabs (as PmWiki default skin does to display available actions).

The skin layout prevent using PageActions pages for defining something else than an action list.

In order to restore the previous skin specific behavior, each action link definition may be followed by a secondary (hidden) link for the rendering of the currently selected tab (aka. for the current action).

Skin previous default behavior would be restored with following sample PageActions customization:

* [[$[View] -> {$FullName}]] %comment%[[{$Group}|{$Groupspaced}/&hellip;]]%%
* [[$[Edit Page] -> {$FullName}?action=edit]]
* [[$[Page Attributes] -> {$FullName}?action=attr]]
* [[$[Page History] -> {$FullName}?action=diff]]
* [[$[Upload] -> {$FullName}?action=upload]]

where the first tab is rendered as a link to either:

'Cookbook/…'
current page group when browsing a page,
'View'
browse current page when performing another action on it.

Link decoration

The skin specific link decoration may be dropped with the following code into your local configuration file:

 $EnableSkinLinkDecoration = 0;

Sometimes, the decoration applied to external links (whose not generated from group/pages) leads to bad looking rendered output (especially when using images as links). The following image link:

 [[http://www.pmwiki.org|http://www.pmichaud.com/img/misc/gem.jpg]]

is (poorly) rendered as:

The solution is to explicitly qualify the link with the %wikilink% style as if it was "internally" generated. The tweaked image link:

 %wikilink% [[http://www.pmwiki.org|http://www.pmichaud.com/img/misc/gem.jpg]]

is (better) rendered as:

Nota (PmWiki version < 2.1 beta 10): when applying this trick to already class-defined elements (such as %lframe% enclosed images), you need to write explicitely the style definition using atomic class elements (as %class='lfloat frame wikilink'% in this case):

 %class='frame wikilink'% [[http://www.pmwiki.org|http://www.pmichaud.com/img/misc/gem.jpg]]

renders as:

Header/Footer customization

Like Grease skin does, several "fixed" parts of the skin (title, wikititle and footer) may be customized from the configuration files via the $SkinPartFmt array variable with regular markup definitions. The skin defaults are:

$SkinPartFmt['wikititle'] = "$WikiTitle - {\$Titlespaced}";
$SkinPartFmt['title'] = '{$Titlespaced}';
$SkinPartFmt['footer'] = ...;

As an interesting side effect, the (:title ...:) directive will therefore handle regular markup (emphasis, links, ...).

Contributor

Dfaure

See also

  • Category: WikipediaSuite - more recipes trying to implement useful Wikipedia-like features in PmWiki.

History

2007-01-25
Fixed $EnableStopWatch handling.
2006-12-05
Another fix for Site.PageActions handling.
2006-11-26
Fixed erroneous Site.PageActions handling.
2006-11-17
Added RecipeInfo data. Added footer customization feature.
2006-09-05
Re-enabled RightBar minimalistic support. Code cleanup and synched with latest PmWiki version.
2006-04-28
Oops, fixed the last fixes ;-)
2006-04-23
Fixed several skin issues (noticeably local styles processing).
2006-03-01
Fixed skin link decoration customization.
2006-02-03
Added SideNote handling. Corrected Attachment decoration behavior.
2005-10-06
Added header customization feature.
2005-09-07
Added handling of Site.PageActions (introduced with PmWiki v2.0 default skin).
2005-09-05
Fixed several visual bugs including latest SideBar styling.
2005-08-05
Revamped attachment links. Dropped deprecated WikiHelp link in page footer. Fixed underlined titles style.
2005-06-17
Fixed forgotten AllRecentChanges link.
2005-06-16
Corrected RightBar placement and added handling of Site group and related directives.
2005-06-10
Added support of RightBar sub pages compatible with 's GeminiSkin and FixFlowSkin.
2005-06-09
Applied suggested changes and relooked print action.
2005-06-03
Handling of forgotten ?action=print and minor tweaks.
2005-06-01
Initial release.

Comments

Is it possible to use fontsizer in monobook skin? We do have problems with high display resolution and can't fix it. The font sizes are too small. --lesn October 25, 2006, at 09:34 AM

FontSizer is only working properly in Gemini (own experience) --lesn October 25, 2006, at 09:49 AM

A small detail (and may not even relate to Monobook itself, I don't know) but Firefox renders the frame markup as a one line high box of the correct width, behind the pic, anchored to the bottom. IE renders correctly as a frame around the pic. rframe and lframe work as expected in Fx and IE Des February 25, 2007, at 09:11 AM

  • Comment:

I've made some alterations to the skin's stylesheet, so it looks more like the original MediaWiki Monobook. I put them all into a single local.css (download here: monobook_plus.zip). Just extract it and put into pmwiki/pub/css/ dir. If you already have your own local.css there, you can just append the contents of this one to it.

In order to make the search block look more like the MediaWiki one, you should also do the following changes to monobook.tmpl:

22:        <div class='pageleftbody' id='sidesearch'>
23:          <form name='searchform' action='{$ScriptUrl}/$[{$SiteGroup}/Search]'>
24:            <input type='hidden' name='pagename' value='$[{$SiteGroup}/Search]'/>
25:            <a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>:<br/>

change to:

22:        <div class='pageleftbodycaption'>$[Search]</div>
23:        <div class='pageleftbody' id='sidesearch'>
24:          <form name='searchform' action='{$ScriptUrl}/$[{$SiteGroup}/Search]'>
25:            <input type='hidden' name='pagename' value='$[{$SiteGroup}/Search]'/>

Few lines should be also added to config.php in pmwiki/local/:

 $SkinPartFmt['wikititle'] = "{\$Titlespaced} &#x2014; $WikiTitle";

# Edit page
 if ($action == 'edit') {
   SDVA($InputTags['e_textarea'], array( 'class' => 'edittextarea' ));
   SDVA($InputTags['e_changesummary'], array( 'size' => '125', 'maxlength' => '255' ));
   SDVA($InputTags['e_author'], array( 'size' => '20', 'maxlength' => '30' ));
   SDVA($InputTags['e_savebutton'], array( ':html' => "<input type='submit' style='font-weight:bold;' \$InputFormArgs />", 'value' => XL('Save'), 'class' => 'editbutton' ));
   SDVA($InputTags['e_previewbutton'], array(  'value' => XL('Preview'), 'class' => 'editbutton' ));
   SDVA($InputTags['e_cancelbutton'], array( 'class' => 'editbutton' ));
 }

# Redirect
 $PageRedirectFmt = "<p style='margin-left: 1em; margin-bottom: 1em; font-size: 11px; color: #7d7d7d;'>($[Redirected from] <a rel='nofollow' href='{\$PageUrl}?action=edit'>{\$FullName}</a>)</p>\$HTMLVSpace\n";

-- Daur March 08, 2007, at 12:42 PM
The Output from 'Print' is always in a serif font
Can this be changed to sans serif?
-- Daydream March 08, 2007, at 11:49AM
Daur, edit the following file in your pmWiki Installation: "/pub/skins/print/print.css"

And in the body declaration change "serif" to "sans-serif" or whatever font you prefer.

Save and refresh. All should be good now.

Is there any way of getting rid of the pmwiki logo and putting your own there?

cheers, promsan

Please refer to InitialSetupTasks --Dfaure July 13, 2009, at 01:59 AM

User notes: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date
* (-) Optional negative comment. Name, date

These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

$StopWatch