Extension:Teahouse
Release status: experimental |
|
|---|---|
| Implementation | other (invalid type), Ajax |
| Description | Provides a modern interface to submit questions about Wikipedia to a community board page |
| Author(s) | Robert Vogel (Talk) |
| MediaWiki | |
| Licence | No licence specified |
| Download | |
| Translate the Teahouse extension if it is available at translatewiki.net | |
| Issues | Open tasks · Report a bug |
The "Teahouse" extension is being developed on behalf of Wikimedia Deutschland e.V.. It is inspired by WPEN Teahouse project and aims to provide a modern interface for new or potential community members to ask questions about the Wikipedia project.
Information about the current state of development can be found at /Development.
Screenshots
Download
The extension can be retrieved directly from Git [?]:
- Browse code
- Some extensions have tags for stable releases.
- Browse tags
- Select the tag
- Click "snapshot"
- Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).
- Browse branches
- Select a branch name
- Click
Continue
Extract the snapshot and place it in the extensions/Teahouse/ directory of your MediaWiki installation.
If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Teahouse.git
Installation
- Download and move the extracted
Teahousefolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Teahouse
- Add the following code at the bottom of your LocalSettings.php file:
require_once "$IP/extensions/Teahouse/Teahouse.php";
Done – Navigate to Special:Versionon your wiki to verify that the extension is successfully installed.
How to set up
This extension provides a MediaWiki gadget, which normally is just JavaScript code within the MediaWiki namespace. To make development more easy it supports two ways to be set up.
Development
There is not much to do but to follow the steps above. In development the extensions runs as standard MediaWiki extension which just adds the JavaScripts/CSS files to ResourceLoader.
Production
Gadgetize.php
The extension includes the mediawiki/Gadgetize.php maintenance script. This script reads in the gadgetize.json file in the root directory and publishes the extensions source files to a target wiki instance.
php maintenance/Gadgetize.php --targetapi=http://mywikiserver/w/api.php --u=MyUserName --p=$3cR3Tp4$$w0rd
MediaWiki:Gadgets-definition
To enable the gadget you will have to edit the MediaWiki:Gadgets-definition page of your wiki and add the line
*teahouse[ResourceLoader|default]|teahouse/main.js|teahouse/teahouse.css *teahouse-opt-in[ResourceLoader]|main.js
Configuration
Default configuration:
{
basePage: 'Wikipedia:Teahouse/Questions', //This is where 'templates.questionWrapper' gets appended to and where questions are created as subpages
insertMarker: '<!-- INSERTMARKER -->',
resourcesPath: mw.config.get('wgScript') + "?title=MediaWiki:Gadget-teahouse",
templates: {
pendingQuestion: 'Teahouse/Pending_question', //Gets appended as {{...}} to the question by mw.teahouse.board.publishQuestion()
answeredQuestion: 'Teahouse/Answered_question', //Not yet used
questionWrapper: 'Teahouse/Question' //Gets added as {{...}} after 'insertMarker' on 'basePage' and with parameter 'title' set to the (basename (!) of the) questions title.
},
i18n: { ... } //Content from i18n/en.json
}
Example configuration by init call:
mw.teahouse.init({
basePage: 'Projekt:Teehaus/Fragen',
resourcesPath: mw.config.get('wgScriptPath') + '/extensions/Teahouse/resources'
i18n: {
"teahouse-button-text": "Stelle deine Frage",
"teahouse-button-title": "Lerne die Community kennen",
"teahouse-dialog-title": "Stelle deine Frage",
... //further contents from i18n/de.json
}
});
