Bücher online kostenlos Kostenlos Online Lesen
Working With MediaWiki

Working With MediaWiki

Titel: Working With MediaWiki Kostenlos Bücher Online Lesen
Autoren: Yaron Koren
Vom Netzwerk:
done, although even just a "Category" tag, to establish a parent category for this category, would do the trick.
    By default, a category page lists its member pages in alphabetical order. This doesn’t always make sense, though: you might want to list people by their last name, you might want to list names that start with “The” under their second word, and so on. You can do that for a particular member page by just adding the indexing string after a pipe in the category tag. For example, to list the page “The Archies” under “Archies, The”, you would place the following in the page “The Archies”:
[[Category:Musical groups|Archies, The]]
    Or, if the page belongs a lot of categories, and you want to index it the same way in all those categories, you can use the “DEFAULTSORT” behavior switch on the member page, like this:
{{DEFAULTSORT:Archies, The}}
[[Category:Musical groups]]
...etc.
    “DEFAULTSORT” can be placed anywhere on the page, though it’s usually placed right above the set of categories, which in turn are usually at the end of the page. (That’s unless you’re using the Semantic MediaWiki system, though, where categories, and default sorting, are usually set via the template.)
    Since the "Category" tag looks exactly like a standard wiki-link, how do you actually link to a category page, instead of making a category declaration? You do that by adding a colon at the beginning of the tag, so the text would look like:
Also check out [[:Category:Butterflies]].
    ...or, if you want custom text in the link, add a "|" and the text after that, just as you would with a regular link:
Also check out the [[:Category:Butterflies|Butterflies]] category.

Namespaces
    Namespaces are how different types of content in the wiki are distinguished. A page is defined as being within a certain namespace if the name of the page begins with the name of that namespace, followed by a colon. So, for instance, the page "Talk:UNIX administration" is in the "Talk" namespace.
    It’s very important to note that a namespace is more than just a prefix: it’s a true separate container of content. So the page "Talk:UNIX administration" is actually considered by the system to be the page "UNIX administration" within the "Talk" namespace.
    Some namespaces can be represented by more than one string. For instance, in non-English-language wikis, the English-language name for a namespace will always work. So, for example, going to the page “Talk:Paavo Nurmi” on a Finnish-language wiki will redirect you to “Keskustelu:Paavo Nurmi”. (“Keskustelu” is Finnish for “discussion”.) This can also happen within one language. In most wikis, the project namespace can be accessed with either the name of the wiki, the string “Project:”, or, for non-English wikis, the corresponding word for “project” in that language. When settings are changed for individual namespaces within LocalSettings.php, the namespaces aren’t referred to by their language aliases, but rather by values like NS_TALK, NS_USER, etc. So if you want to enable subpages for just “User:” pages, for example (we’ll get to subpages here ), you would add the following line to LocalSettings.php:
$wgNamespacesWithSubpages[NS_USER] = true;
    NS_TALK, NS_USER etc. are actually PHP constants, that in turn simply represent numbers (NS_TALK is 1, for example). Each namespace’s number is unique. Pages whose names don’t contain a colon are still part of a namespace: that’s the "main" or "blank" namespace, denoted by NS_MAIN in LocalSettings.php (which has the numeric value 0). Similarly, pages whose names do contain a colon, but whose string before the colon doesn’t correspond to an active namespace, are also in the main namespace: a page named "Happy:Times" is just the page "Happy:Times" in the main namespace, not a page called "Times" in the "Happy" namespace, unless a "Happy" namespace has been defined on this wiki. Namespaces are used for many types of content; below is the listing of each namespace that comes by default in MediaWiki, along with its PHP constant, its actual numeric value, its English-language alias, and its purpose:
    Namespace constant
#
English-language alias(es)
Purpose
NS_MEDIA
-2
"Media"
Used for directly linking to uploaded files
NS_SPECIAL
-1
"Special"
Used for special pages defined by the software
NS_MAIN
0
(no text)
Most user-created content
NS_TALK
1
"Talk"
Discussions about pages in the main

Weitere Kostenlose Bücher