[Mediawiki-l] automatic template

Dave Sigafoos davesigafoos at sanmar.com
Tue Jul 31 13:25:40 UTC 2007


Jim is right .. 

'Changes to LocalSettings.php' shows this

require_once("$IP/extensions/Boilerplateselection/Boilerplateselection.php");
global $wgBoilerPlateAry;
$wgBoilerPlateAry = array('Sandbox' => 'Boilerplate');

Here, anytime the word 'Sandbox' is found in the article it will looke for a template called 'Boilerplate' and use that text as the seed.

Here is the one we are currently using .. 

# dsig   12jun07 rights overwritten - user cannot move page
require_once("extensions/boilerplateselection.php");
global $wgBoilerPlateAry;
$wgBoilerPlateAry = array('Technical' => 'TechnicalDesign', 'Scope' => 'Scope');

In this case when it finds the word 'Technical' it will use the template TechnicalDesign.  When it finds the word 'Scope' it will use the template 'Scope'.

Hope this clears it up.

Sorry about that.  I will update the document to be more clear.

DSig
David Tod Sigafoos | SANMAR Corporation
PICK Guy
206-770-5585
davesigafoos at sanmar.com 

 


-----Original Message-----
From: mediawiki-l-bounces at lists.wikimedia.org [mailto:mediawiki-l-bounces at lists.wikimedia.org] On Behalf Of Henrik Rasmussen
Sent: Tuesday, July 31, 2007 2:25
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] automatic template

This is really great. I needed that. Thanks. But it gives me some troubles, maybe because i'm not a php guy so i'm sure i'm doing it wrong somewhere.

I have implementet it like described in http://www.mediawiki.org/wiki/Extension:BoilerplateSelection and I have made two templates in our MediaWiki:

Template:Boilerplate and Template:Serverskabelon (actually in Danish Skabelon:Boilerplate and Skabelon:Serverskabelon).

I have then modified the file Localsettings.php like this

$wgBoilerPlateAry = array('Sandbox' => 'Boilerplate', 'Sandbox' => 'Serverskabelon');

Which is probably where the problem is (however, even the content is just $wgBoilerPlateAry = array('Sandbox' => 'Serverskabelon'); it still have the content of the Template:Boilerplate, probably because this is default).

As I understand it, it is the title of the document that is used to determine the template. So I understand this as I will have to make an address like this http://MyWiki.Mysite.dk/MyWiki/index.php?title=Serverskabelon_mydocument&action=edit

But still every document I make contains the text from the standard Boilerplate

How exactly do I have to do to make it work, and (if i'm totally off track) how exactly do I get to select between the templates (examples is appreciated).

Henrik Rasmussen



-----Oprindelig meddelelse-----
Fra: mediawiki-l-bounces at lists.wikimedia.org [mailto:mediawiki-l-bounces at lists.wikimedia.org] På vegne af Linus Chu
Sendt: 23. juli 2007 23:12
Til: MediaWiki announcements and site admin list
Emne: Re: [Mediawiki-l] automatic template

works great!

Dave Sigafoos <davesigafoos at sanmar.com> wrote: Two similar extensions .. 

Boilerplate - http://www.mediawiki.org/wiki/Extension:Boilerplate

BoilerplateSelection
http://www.mediawiki.org/wiki/Extension:BoilerplateSelection



Boilerplate uses 1 *template* to stuff text into every new page

BoilerplateSelection uses the title of the article to determine the
*template* to stuff into the article.

DSig
David Tod Sigafoos | SANMAR Corporation
PICK Guy

 

-----Original Message-----
From: mediawiki-l-bounces at lists.wikimedia.org
[mailto:mediawiki-l-bounces at lists.wikimedia.org] On Behalf Of Linus Chu
Sent: Sunday, July 22, 2007 18:04
To: mediawiki-l at lists.wikimedia.org
Subject: [Mediawiki-l] automatic template

Is there a way to put default text on every page so that every time
someone creates an article, the default text will already be in the
article?

any help appreciated


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l


       
---------------------------------
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l



More information about the MediaWiki-l mailing list