Extension:Boilerplate
From MediaWiki.org
| The author of this extension is no longer maintaining it! Meaning any reports for additional features and/or bugfixes will more than likely be ignored. Volunteers are encouraged to take on the task of developing and maintaining it. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{extension}} infobox. |
| This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net. |
Several users have reported bugs with this extension related to unmodifiable headers, please see the discussion tab for details. There are a few other extensions which may or may not offer the same functionality but are more up to date with recent versions of media wiki.
|
Boilerplate Release status: experimental |
|||
|---|---|---|---|
| Implementation | Page action | ||
| Description | Loads boilerplate text for a brand new page. | ||
| Author(s) | Rouslan Zenetl (RouslanZenetltalk) | ||
| Last version | 0.0.3 (2007-11-04) | ||
| MediaWiki | 1.6.8 - 1.11.0 | ||
| Database changes | no | ||
| License | GPL v3 | ||
| Download | Download and Installation | ||
|
|||
| Check usage and version matrix | |||
The Boilerplate extension loads pre-defined text (from a page named Boilerplate that you create on your MediaWiki site) when a brand new page is created.
Download and Installation [edit]
Step 1: Copy-paste this code into a file boilerplate.php and place it in extensions directory.
<?php $wgHooks['EditPage::showEditForm:initial'][] = array('boilerplate'); $wgExtensionCredits['other'][] = array( 'name' => 'Boilerplate', 'author' => '[http://rouslan.zenetl.com/ RouslanZenetl]', 'version' => '0.0.3', 'description' => 'Loads pre-defined text from [[MediaWiki:Boilerplate]] when a brand new page is created', 'url' => 'https://www.mediawiki.org/wiki/Extension:Boilerplate' ); function boilerplate($editpage) { // EditFormPreloadText global $wgOut; $wgOut->enableClientCache(false); if (!$editpage->preview && !$editpage->mArticle->mContentLoaded && $editpage->mArticle->mTitle->mNamespace==0) { $boilerplate_title = Title::newFromText('boilerplate'); $boilerplate_article = new Article($boilerplate_title); $editpage->textbox1=$boilerplate_article->GetContent(); $editpage->textbox2=$editpage->textbox1; } return true; }
Step 2: Add the following line to LocalSettings.php:
require_once("$IP/extensions/boilerplate.php");
Step 3: Create a page named Boilerplate on your MediaWiki site. Whatever is included in this Boilerplate page will serve as the default template for any new pages created on your site.
Thats it!
License [edit]
See Also [edit]
- Extension:MultiBoilerplate
- Extension:Preloader provides per-namespace preload text
- Extension:PreloadManager provides per-namespace preload text
- Extension:HeaderFooter provides per-namespace header/footer text
- Extension:NewArticleTemplates provides per-namespace preload text
perhaps Extension:Preloader, Extension:PreloadManager, Extension:NewArticleTemplates and Boilerplate should be merged?