User:Applicationswhisperer

See what we did:

LongJump Support

About Me
I have experience in marketing, training, technical communications and support desk operations:
 * Technology is my friend, and I am comfortable handling most L1/L2 PC problems
 * I have enough UNIX experience to be dangerous
 * Until now, I have used other tools to create user documentation (FrameMaker, RoboHelp, DreamWeaver, Acrobat), plus some of the early programming languages...so, Fortran, Cobol and BASIC, yes. PHP and mySQL, no, but learning very quickly.

Currently, I'm a technical writer in the SF Bay area. Contact me at eyodertw at yahoo dot com.

MW Lessons Learned
Goal:
 * one wiki supporting two products
 * single source the articles (i.e. write once, use many)

Result:
 * This is possible in MediaWiki with templates, inclusions and parser functions
 * Since we did our wiki editing live, this combo saved the day: TextPad, FireFox and the It's All Text extension

Key Resources: Use them, they are your friends when you're a newbie:
 * Manual:FAQ
 * MediaWiki announcements and site admin list

Setup

 * 1) Acquire a site; we used Siteground; for the purposes of this article, my site name is: www.foo.com
 * 2) Install MW according to the excellent instructions at MediaWiki
 * install MW in the /wiki folder, i.e. /www/wiki
 * 1) Create new folders (under /www, at the same level as /wiki):
 * /apples
 * /oranges
 * These folders are empty!!!

Prep the Skin Files
Find the following folder/files, in the /skins folder
 * {| border="1" cellpadding="5" cellspacing="0"
 * {| border="1" cellpadding="5" cellspacing="0"

/skins/monobook</tt> /skins/apples_monobook</tt>
 * Copy this...
 * ...and Paste as:

/skins/oranges_monobook</tt> /skins/MonoBook.deps.php</tt> /skins/apples_MonoBook.deps.php</tt>

/skins/oranges_MonoBook.deps.php</tt> /skins/MonoBook.php</tt> /skins/apples_MonoBook.php</tt>

/skins/oranges_MonoBook.php</tt>
 * }

Customize the Skins Files
With your handy-dandy text editor, customize the /skins/apples_MonoBook.php</tt> and /skins/oranges_MonoBook.php</tt> files with the following code; This code is is located near the beginning of the file; This is (obviously) a sample for Apples. Do it again for Oranges. Pay attention to CaPitaLIzaTIon: /** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document * @ingroup Skins */ class SkinApples_MonoBook extends SkinTemplate { /** Using monobook. */	function initPage( &$out ) { SkinTemplate::initPage( $out ); $this->skinname = 'apples_monobook'; $this->stylename = 'apples_monobook'; $this->template = 'Apples_MonoBookTemplate'; # Bug 14520: skins that just include this file shouldn't load nonexis- # tent CSS fix files. $this->cssfiles = array( 'IE', 'IE50', 'IE55', 'IE60', 'IE70', 'rtl' ); } }

/** * @todo document * @ingroup Skins */ class Apples_MonoBookTemplate extends QuickTemplate {

Create Logo and Favicon Files

 * Create apples_logo.png</tt> file and place it in this folder: skins/common/images/</tt>
 * Create oranges_logo.png</tt> file and place it in this folder: skins/common/images/</tt>
 * Create apples_favicon.ico</tt> file and place it in this folder: <tt>/www/wiki/</tt> root (i.e. <tt>$wgScriptPath</tt> in this example)
 * Create <tt>oranges_favicon.ico</tt> file and place it in this folder: <tt>/www/wiki/</tt> root (i.e. <tt>$wgScriptPath</tt> in this example)

Customize <tt>localsettings.php</tt>

 * 1) In <tt>localsettings.php</tt> add this block of code at the end; It will set the sitename, based on hostname
 * 2) Install any other extensions, also at the end;

$wgEnableParserCache = false; $wgCachePages = false;
 * 1) added to resolve Apples vs Oranges parserfunction issues on the home page
 * 1) added to resolve Apples vs Oranges parserfunction issues on the home page

if(($_SERVER['HTTP_HOST'])==('apples.foo.com')) {   $wgSitename = 'Apples Support'; $wgLocalInterwiki  = $wgSitename; ## Default skin for Apples
 * 1) Choose the wiki support site, based on the host name (apples.foo.com or oranges.foo.com)
 * 1) Choose the wiki support site, based on the host name (apples.foo.com or oranges.foo.com)

$wgDefaultSkin = 'applesmonobook'; $wgLogo = "skins/common/images/apples_logo.png";

$wgFavicon = "$wgScriptPath/apples_favicon.ico";

}

else if(($_SERVER['HTTP_HOST'])==('lj.foo.com')) {   $wgSitename = 'Oranges Support'; $wgLocalInterwiki  = $wgSitename; ## Default skin for Oranges

$wgDefaultSkin = 'orangesmonobook'; $wgLogo = "skins/common/images/oranges_logo.png";

$wgFavicon = "$wgScriptPath/oranges_favicon.ico";

} else {   ## For convenience, all edits are conducted from (wiki.foo.com) ## (With my avatar as the logo, it makes me happy,   ##  and whatever makes me happy helps me be more effective) $wgSitename = 'SandBox Support Wiki'; $wgLocalInterwiki  = $wgSitename; ## Default skin: you can change the default skin. Use the internal symbolic ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':

$wgDefaultSkin = 'monobook'; $wgLogo = "skins/common/images/sandbox.png";

}

Parser Functions are Your Friend
With the site setup as outlined here, the following parser function can be used to substitute one page for another, depending on the name of the site.

Extensions We Use

 * ContactPage
 * TopTenPages
 * BreadCrumbs2
 * ParserFunctions

CSS for Dummies
Get friendly with your local web developer. Provide a copy of the monobook folder and ask for whatever css cusomizations strike your fancy. Don't go wild, tho, because making major changes will break some extensions. My advice is to stay with basic fonts and colors, logos and favicons. We went very zen (LongJump Support).

Now for the Magic
Build the following template pages.

Tree chooses which tree to display in the SideBar (based on Category Tree extension).

Template:Tree

Apples is the contents of the Apples site SideBar: Template:Apples
 * navigation
 * mainpage|Main Page
 * topic-1|Topic 1
 * topic-2|Topic 2
 * topic-n|Topic N
 * Category:Glossary|Glossary
 * topic-n|Topic N
 * Category:Glossary|Glossary
 * Category:Glossary|Glossary

Oranges contains the Oranges site SideBar: Template:Oranges
 * navigation
 * mainpage|Main Page
 * different-topic-1|Topic 1
 * different-topic-2|Topic 2
 * different-topic-n|Topic N
 * different-topic-n|Topic N
 * different-topic-n|Topic N
 * different-topic-n|Topic N

In MediaWiki:Sidebar, add:

Brand template plugs in the Apples or Oranges name whenever needed in an article. Where behavior is the same and only the name is different, use this:

Template:Brand <!--contents of Template:Brand>

Within pages, use Template:Brand This is an article about the industrial-strength power of bla-de-bla...

Which results in an article containing one of the following, depending on the URL they visited:


 * This is an article about the Apples industrial-strength power of bla-de-bla...
 * This is an article about the Oranges industrial-strength power of bla-de-bla...