Hilfe:Hilfe

aus www.kruedewagen.de, Homepage von Ralf und Judith Krüdewagen (Kruedewagen)
Zur Navigation springen Zur Suche springen

MediaWiki Hilfe

Update

Vorlagen

Siehe Vorlagen oder

Vorlagen können auch beliebige (?) Subpages sein, z.B. Sandbox/Vorlage1. Einzubinden dann z.B. auf der Seite Sandbox relativ mittels {{/Vorlage1}}.

Auflisten der Seiten, die eine Vorlage verwenden mittels: {{Vorlage:Vorlagennutzer}}

Benutzung und Konfiguration von MediaWiki

Namensräume

  • Namensräume müssen in LocalSetting.php definiert werden. Ansonsten gilt "Namensraum:seite" nicht als Namensraum. Man erkennt die Gültigkeit auch daran, dass bei echten Namensräumen der erste Buchstabe hinter dem ":" beim Speichern automatisch groß geschreiben erscheint. Auch werden die Suchseiten automatisch um den neuen Namensraum erweitert.

Interwiki-Linking

Beispiel:

INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans, iw_api, iw_wikiid) VALUES ('kruedewagen','http://www.kruedewagen.de/wiki/$1', 1, 0, '', '');

Sidebar anpassen

Hinweis: Die übergeordneten Menü-Titel dürfen keine Leerzeichen enthalten (da als id-Tag sonst nicht W3C-konform). Ggf. mit "_" trennen und dann in entsprechender Wiki-Seite "MediaWiki:Andere_Themen" Leerzeichen einfügen.

Siehe auch:

Layout

Tagline / Pagetitle

  • MediaWiki:Tagline (siteSub)
  • MediaWiki:Pagetitle

Session Timeout

Folgenden Parameter in /etc/php.ini setzen

session.gc_maxlifetime = 3600

PHP-Funktionalität im Wiki aktivieren

Folgende Funktion in includes/Setup.php hinzufügen:

function ParsePHPTag($Content)
{
 global $wgOut;
 $wgOut->enableClientCache(false);
 ob_start();
 eval($Content);
 $Result = ob_get_contents();
 ob_end_clean();
  return($Result);
}
$wgParser->setHook('php','ParsePHPTag');

Um PHP in den Wiki-Seiten zu nutzen, statt <?PHP ... ?> nun <PHP> ... </PHP> verwenden.

Beispiel:

<PHP>
$db = mysql_connect("localhost", "userid", "userpassword");
mysql_select_db("testdb",$db);

$result = mysql_query("SELECT COUNT(*) zeilen FROM table",$db);
printf("Zeilen: %s\n", mysql_result($result,0,"zeilen"));
</PHP>

Links

Links zum eigenen Server können mittels der SERVER Variablen angelegt werden, z.B. KRÜDEWAGEN BLOG. Wiki-Syntax: [{{SERVER}}/blog/ KRÜDEWAGEN BLOG]

Dabei wird SERVER durch die komplette URL ersetzt, mit der das Wiki aufgerufen wurde (auch mit https möglich).

  • Hinweis 1

Die SERVER Variable wird im Cache des Wikis (auf dem Server, pro Seite) gehalten, ändert sich also nicht zwangsläufig sofort bei Verwendung einer anderen URL. Cache kann mit &action=purge geleert werden.

  • Hinweis 2

Wenn ein Link in der Sidebar gesetzt wird, wird die SERVER Variable nicht im Cache gehalten.

Links mit "action" Parameter

Siehe http://www.sciencemedianetwork.org/wiki/Mediawiki_templates_for_edit_and_history

Beispiel-Link zur Versionsgeschichte:

<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=history}} edit history]</span>

Hinweis: Mit dem "span" wird der Link als "intern" markiert.

Wiki URL

Cache-Einstellungen

$wgParserCacheType = CACHE_ANYTHING;
$wgParserCacheExpireTime = 3600;

$wgEnableParserCache = true;
$wgEnableSidebarCache = false;

Variablen

Siehe http://www.mediawiki.org/wiki/Help:Variables/de.

Tags mit Extensions und Templates

Siehe

Copyright-Text im Footer und Editor ändern

Warnung im Editor:

Anpassung im Footer in LocalSettings.php:

$wgRightsPage = "www.kruedewagen.de:Lizenz"; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "CC BY-NC-SA 3.0";
$wgRightsIcon = "{$wgUploadPath}/f/f2/By-nc-sa.eu.svg";

Siehe auch Lizenz.

Footer ändern

Skin anpassen

Subpages

Siehe

Subpages müssen per Namespace aktiviert werden.

Zur "Simulation" einer Subpage durch Anzeigen einer Navigation: http://de.wikipedia.org/wiki/Vorlage:Subpage

HowTo / FAQ

Wiki Redirects

#redirect [[Page]]

Clear cache for a page

Sometimes the MediaWiki caching system needs to be reset manually for a certain page.

  • Go to the page
  • Hit "history"
  • Change the URL from "action=history" to "action=purge"
  • Press "Enter"

Revert / Undo changes of a page

See http://en.wikipedia.org/wiki/Wikipedia:Revert.

Subpages

Subpage is a subpage of the current page. You can link to that subpage from any other page by Help:Contents/Sub1.

To activate subpages in the main namespace, add the following to LocalSettings.conf

$wgNamespacesWithSubpages[NS_MAIN] = true;

Change Sidebar

See also:

Change toolbar link text

Since addMessages() has been removed, some extensions don't print a proper link text any more when added into the toolbar.

  • Check the related message page by appending ?uselang=qqx' to the page's index.php/, for example
http://www.kruedewagen.de/wiki/index.php?uselang=qqx
http://www.kruedewagen.de/wiki/index.php?title=Sandbox&uselang=qqx
  • Edit or create that message page in the MediaWiki namespace, for example
MediaWiki:Smw_browselink

Add user

Special:Userlogin (as Sysop)

Reset user password

This can only be done by the following SQL statements

Find out the user_id
select user_id, user_name from user where user_name='myname';
Set a new password
update user set user_password = md5(CONCAT('123-',md5('newpassword'))) WHERE user_id=123;


Increase Session Timeout

Set the following parameter in /etc/php.ini for increasing the session timeout (that's the maximum time you need to save the page you are editing without losing your work):

session.gc_maxlifetime = 3600

HTML code listings

HTML code like <h1> should be enclosed with <nowiki></nowiki> tags,even if they are already enclosed with "pre" tags. Otherwise mediawiki will corrupt the page if you edit a single section (bug?).

Sample wiki syntax:

<h1>Caption</h1>

Embed Template or Page

  • Template: {{template_name}}
  • Page: {{:page_name}}

How do I rename my Wiki

See http://www.mediawiki.org/wiki/Manual_talk:FAQ#How_do_I_rename_my_wiki.3F .

Dump Import

Nach einem XML Export kann man eine neue Seite importieren durch Anpassen der XML Datei.

<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.6/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.6/ http://www.mediawiki.org/xml/export-0.6.xsd" version="0.6" xml:lang="en">
  <siteinfo>
   ...
  </siteinfo>
  <page>
    <title>Testimport1</title>
    <ns>0</ns>
    <revision>
      <contributor>
        <username>Username</username>
        <id>99</id>
      </contributor>
      <text xml:space="preserve">Das ist der Source Code der Wiki Seite</text>
    </revision>
  </page>
</mediawiki>

Siehe auch:

Hinweise:

  • <siteinfo> aus einem aktuellen Export verwenden.
  • Mehrere <page> Elemente können eingefügt werden.
  • <username>Username</username> und <id>99</id> müssen angepasst werden gemäß den Werten aus Spezial:Einstellungen.
  • Existierende Seiten gemäß <title> werden überschrieben.
  • Import nur von Admin möglich.

Configure Wiki-specific Favicon

The favicon file should have 16x16 pixels. Add to LocalSettings.php:

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

Sortable Table

Row 1 Row 2 Row 3
a b 3
x y 2
c f 1

Sortable table (header must be given with "!"), see Sorting:

Col A Col B Col C Date
x y 1 01-Jan-2010
a z 2 11-Dec-2012
bv ui 3 31-Jul-2011

Source Code Listings

Source code can be listed within <source lang="php"></source> tags. This feature is provided by the SyntaxHighlight_GeSHi extension.

Example:

// Extension SyntaxHighlight_GeSHi
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");

You can also combine this with the the Pre2 template (see below).

Pre-Formatting Text

Two templates Template:Pre and Template:Pre2 can be used for pre-formatting text with long lines. Even Template:Pre2 adds line breaks in the wiki output, it can also add a scroll bar.

Pre2: {{Pre2|text}}

mkdir -p /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/
wget http://ftp.debian.org/dists/etch/main/installer-i386/current/images/cdrom/debian-cd_info.tar.gz -O /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/debian-cd_info.tar.gz
wget http://ftp.debian.org/dists/etch/main/installer-i386/current/images/cdrom/initrd.gz -O /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/initrd.gz
wget http://ftp.debian.org/dists/etch/main/installer-i386/current/images/cdrom/vmlinuz -O /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/vmlinuz


Pre2 with scrolling: {{Pre2|scroll|text}}

mkdir -p /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/
wget http://ftp.debian.org/dists/etch/main/installer-i386/current/images/cdrom/debian-cd_info.tar.gz -O /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/debian-cd_info.tar.gz
wget http://ftp.debian.org/dists/etch/main/installer-i386/current/images/cdrom/initrd.gz -O /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/initrd.gz
wget http://ftp.debian.org/dists/etch/main/installer-i386/current/images/cdrom/vmlinuz -O /var/tmp/mucontrol_image/dists/etch/main/installer-i386/current/images/cdrom/vmlinuz


Page breaks in PDF output

You can force a page break in the PDF output using the RawMsg extension by adding one of the following to your wiki page:

  • Using the extension directly:
{{#rawmsg:pagebreak}}
{{pagebreak}}

See also HTMLDOC comments.

Timelines

Extension EasyTimeline mit Ploticus.

Beispiel 1:

<timeline> TimeAxis = orientation:horizontal ImageSize = width:680 height:200 PlotArea = width:620 height:150 bottom:50 left:20 DateFormat = dd/mm/yyyy

  1. AlignBars = early

Period = from:01/12/2004 till:01/02/2009

  1. Colors see http://ploticus.sourceforge.net/doc/color.html

Colors =

 id:canvas value:rgb(0.97,0.97,0.97)
 id:grid   value:rgb(0.86,0.86,0.86)
 id:bars   value:gray(0.85)
 id:magenta1  value:magenta #
 id:orange1   value:orange #
 id:green2   value:brightgreen #
 id:purple1   value:purple #
 id:blue2   value:darkblue #
 id:blue3   value:powderblue #
 id:orange2   value:lightorange #
 id:yellow1   value:yellow #
 id:green3   value:teal #

ScaleMajor = unit:month increment:1 start:01/01/2005 gridcolor:grid BackgroundColors = canvas:canvas

BarData=

 barset:pert
 bar:Monat

PlotData=

  1. set defaults
 width:25 fontsize:M textcolor:black align:left anchor:from shift:(10,-5) color:bars
 barset:pert
 from:01/12/2004 till:31/03/2005 color:blue3 text:"P h a s e 1"
 from:01/04/2005 till:30/09/2005 color:orange2 text:"P h a s e 2"
 from:01/10/2005 till:30/04/2006 color:yellow1 text:"P h a s e 3"
 from:01/05/2006 till:10/11/2006 color:green3 text:"P h a s e 4"
 from:12/11/2006 till:31/07/2007 color:red text:"P h a s e 5"
 from:01/08/2007 till:28/04/2008 color:orange1 text:"P h a s e 6"
 from:29/04/2008 till:30/11/2008 color:green2 text:"P h a s e 7"
 bar:Monat width:5 align:center fontsize:S shift:(0,-45) anchor:middle color:canvas
 from:01/01/2005 till:01/02/2005 text:Jan
 from:01/03/2005 till:01/04/2005 text:Mar
 from:01/05/2005 till:31/05/2005 text:May
 from:01/07/2005 till:31/07/2005 text:Jul
 from:01/09/2005 till:01/10/2005 text:Sep
 from:01/11/2005 till:01/12/2005 text:Nov
 from:01/01/2006 till:01/02/2006 text:Jan
 from:01/03/2006 till:01/04/2006 text:Mar
 from:01/05/2006 till:31/05/2006 text:May
 from:01/07/2006 till:31/07/2006 text:Jul
 from:01/09/2006 till:01/10/2006 text:Sep
 from:01/11/2006 till:01/12/2006 text:Nov
 from:01/01/2007 till:01/02/2007 text:Jan
 from:01/03/2007 till:01/04/2007 text:Mar
 from:01/05/2007 till:31/05/2007 text:May
 from:01/07/2007 till:31/07/2007 text:Jul
 from:01/09/2007 till:01/10/2007 text:Sep
 from:01/11/2007 till:01/12/2007 text:Nov
 from:01/01/2008 till:01/02/2008 text:Jan
 from:01/03/2008 till:01/04/2008 text:Mar
 from:01/05/2008 till:31/05/2008 text:May
 from:01/07/2008 till:31/07/2008 text:Jul
 from:01/09/2008 till:01/10/2008 text:Sep
 from:01/11/2008 till:30/11/2008 text:Nov
 from:01/01/2009 till:01/02/2009 text:Jan

</timeline>

Beispiel 2: <timeline> ImageSize = width:900 height:auto barincrement:20 PlotArea = top:10 bottom:30 right:130 left:20 AlignBars = early

DateFormat = dd/mm/yyyy Period = from:01/01/2008 till:31/12/2008 TimeAxis = orientation:horizontal ScaleMajor = grid:black unit:month increment:1 start:01/01/2008

  1. Colors see http://ploticus.sourceforge.net/doc/color.html

Colors =

 id:canvas      value:rgb(0.97,0.97,0.97)
 id:c1   value:green
 id:c2   value:red
 id:c3   value:blue
 id:c4   value:tan2
 id:c5   value:magenta
 id:c6   value:black
 id:c7   value:orange
 id:c8   value:claret
 id:c9  value:magenta #
 id:c10   value:orange #
 id:c11   value:darkblue
 id:c12   value:yellow
 id:c13   value:teal
 id:c14   value:brightblue
 id:free   value:brightgreen
 id:purple1   value:purple #
 id:blue2   value:darkblue #
 id:eddchri   value:powderblue #
 id:orange2   value:lightorange #
 id:yellow1   value:yellow #
  1. id:green3 value:teal #

Backgroundcolors = canvas:canvas

BarData =

 barset:Vacation
 bar:Monat

PlotData=

 barset:Vacation width:5 align:left fontsize:S shift:(5,-4) anchor:till
 from:04/02/2008 till:04/02/2008 color:c1 text:"name1(04.02)"
 from:14/03/2008 till:14/03/2008 color:c1 text:"name1(14.03)"
 from:11/04/2008 till:14/04/2008 color:c2 text:"name2(11.-14.04)"
 from:02/05/2008 till:02/05/2008 color:c1 text:"name1(02.05)"
 from:02/05/2008 till:02/05/2008 color:c2 text:"name2(02.05)"
 from:23/05/2008 till:23/05/2008 color:c1 text:"name1(23.05)"
 from:15/09/2008 till:19/09/2008 color:c1 text:"name1(15.-19.09)"
 from:24/12/2008 till:24/12/2008 color:c1 text:"name1(24.12)"
 from:31/12/2008 till:31/12/2008 color:c2 text:"name2(31.12)"
 barset:skip
 from:31/12/2008 till:31/12/2008 color:c3 text:"name3(31.12)"
 barset:skip
 from:31/12/2008 till:31/12/2008 color:c4 text:"name4(31.12)"
 barset:skip
 from:31/12/2008 till:31/12/2008 color:c5 text:"name5(31.12)"
 barset:skip
 bar:Monat width:5 align:center fontsize:S shift:(0,-20) anchor:middle color:canvas
 from:01/01/2008 till:01/02/2008 text:Jan
 from:01/02/2008 till:01/03/2008 text:Feb
 from:01/03/2008 till:01/04/2008 text:Mar
 from:01/04/2008 till:01/05/2008 text:Apr
 from:01/05/2008 till:01/06/2008 text:Mai
 from:01/06/2008 till:01/07/2008 text:Jun
 from:01/07/2008 till:01/08/2008 text:Jul
 from:01/08/2008 till:01/09/2008 text:Aug
 from:01/09/2008 till:01/10/2008 text:Sep
 from:01/10/2008 till:01/11/2008 text:Okt
 from:01/11/2008 till:01/12/2008 text:Nov
 from:01/12/2008 till:31/12/2008 text:Dez

</timeline>

Semantic MediaWiki

  • Set a property: [[attTest::Dummyentry]]: Dummyentry
  • Hide a property: [[attTest::Dummyentry| ]]:
  • Enter Property/Attribute page, will list all pages with that property: [[Property:attTest]] , Example:Property:attTest
  • Set data type of a property: Write e.g. [[Has type::number]] into the page of the property [[Property:attTest]], Example:Property:attTest



  • Inline Query: {{#ask: [[attTest::Dummyentry]] | ?attTest | ?attTest2}}:
  • Inline Query: {{#ask: [[attTest2::2000]] | ?attTest | ?attTest2}}:
 AttTestAttTest2
HilfeDummyentry
  • Inline Query (show): {{#show: Dummyentry | ?attTest2 = }},


  • Create Concept: Enter {{#concept: [[attTest2::2000]] | Descrition of Concept }} on page [[Concept::TestConcept]]

Style

CSS-Styles sollten in MediaWiki:Vector.css oder besser in MediaWiki:Common.css angepasst werden. Siehe auch http://semantic-mediawiki.org/wiki/Help:Table_format.

Line Breaks / Zeilenumbruch

Wenn z.B. in Templates Attribute ausgegeben werden und dabei - wenn dieses leer sind - ungewünscht Zeilenumbrüche eingefügt werden, dann man man das mit einem einzelnen <nowiki/> Tag beheben. Damit werden z.B. leere Text-Attribute auch wirklich leer ausgegeben. Beispiel innerhalb eines Templates:

{{#if: {{{Para1|}}}|[[Att1::{{{Para1|}}}]]}}<nowiki/>

Siehe auch:

Liste in Template und Tabelle

Wenn man einem Template-Parameter einen Text übergibt, der direkt mit einem "*" anfängt (Liste), dann muss man zuvor eine Leerzeile einfügen, damit der Listenanfang erkannt wird, sonst wird es als "=*" interpretiert.

Beispiel:

{{#if: {{{Para1|}}}|
{{!}} '''Überschrift'''
{{!}}<!-- hier Leerzeile --->
[[Att1::{{{Para1|}}}]]
{{!}}-
}}

Siehe auch:

Semantic Forms

See mediawiki.org

Siehe auch