[Mediawiki-l] automatic template

Jim Hu jimhu at tamu.edu
Tue Jul 31 11:52:38 UTC 2007


I believe "Sandbox" is just an example of a search key.  I think you  
need different values for the key.

$wgBoilerPlateAry = array(
	'Sandbox' => 'Boilerplate',	# looks for Sandbox in the page title
  	'Sandbox' => 'Serverskabelon' # looks for Sandbox in the page  
title, never executes because the first line sees Sandbox first
	);

All page names that don't contain 'Sandbox' fall through and use  
'Boilerplate', so you can't tell the difference between "Sandbox" and  
anything else.  What you want is something like

$wgBoilerPlateAry = array(
	'key1' => 'boilerplate template 1',	# looks for key1 in the page title
  	'key2' => 'boilerplate template 2' 	# looks for key2 in the page  
title, different from key1
	);

Hope this helps  (I actually use PagesOnDemand for this so I'm just  
inferring the behavior from the code).

Jim

On Jul 31, 2007, at 4:25 AM, Henrik Rasmussen wrote:

> 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

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054




More information about the MediaWiki-l mailing list