Sarna News: Bad 'Mechs - Cyllaros

Information:Namespaces

(Redirected from BTW:namespace)
BattleTechWiki data structure
Namespaces
Subject namespaces Talk namespaces
0 (Main/Article) Talk 1
2 User User talk 3
4 BattleTechWiki BattleTechWiki talk 5
6 File File talk 7
8 MediaWiki MediaWiki talk 9
10 Template Template talk 11
12 Help Help talk 13
14 Category Category talk 15
100 Policy Policy Talk 101
102 Property Property talk 103
106 Form Form talk 107
108 Concept Concept talk 109
112 smw/schema smw/schema talk 113
118 Draft Draft Talk 119
460 Campaign Campaign talk 461
828 Module Module talk 829
3000 Portal Portal Talk 3001
3010 Guideline Guideline Talk 3011
3012 Information Information Talk 3013
Virtual namespaces
-1 Special
-2 Media
Current list (API call)

A BattleTechWiki namespace is a set of BattleTechWiki pages whose names begin with a particular reserved word recognized by the MediaWiki software (followed by a colon). For example, in the user namespace all titles begin with the prefix User:. In the case of the article (or main) namespace, in which encyclopedia articles appear, the reserved word and colon are absent. (Note: main space articles can optionally include a colon at the beginning with no reserved word, so [[Article]] and [[:Article]] are equivalent. This is usually only necessary for the advanced technique of transcluding a main space article into a page in another namespace.)

More generally, a BattleTechWiki namespace is a class of pages that falls under a common type. All pages in the User namespace, for example, are user pages, whereas Drafts are in the Draft namespace. This page is in the Information namespace, for information or discussions about the project itself and its policies.

BattleTechWiki has a more than 30 Namespaces, these are all listed in the box to the right. While surfing BattleTechWiki, a list of namespaces is available in two clicks: do an empty search, then click Advanced under the search box. The list also makes itself available where needed in the dropdown menus of, for example, Special:Prefixindex, Special:Allpages, Special:Recentchanges, and Special:Contributions.

Subject namespaces[edit]

Namespaces allow for the organization and separation of content pages from administration pages. Namespaces separate data into core sets, those intended for public viewing, and those intended for the editing community. BattleTechWiki's subject namespaces and their functions are listed below. A brief description is provided, but see the link for more information.

A namespace is sometimes called a space, for short, as in "Project space". A subject page and its talk page form a pair.

Current namespaces[edit]

  • Main namespace (no prefix): contains all encyclopedia articles, lists, disambiguation pages, and encyclopedia redirects. Sometimes referred to as "mainspace" or "Article".
  • User namespace (prefix User:): contains user pages and other pages created by individual users for their own personal use. Pages under this namespace can still be viewed and modified by others, so do not keep any of your sensitive data here.
  • BattleTechWiki namespace or Project namespace (prefix BattleTechWiki:): contains many types of pages connected with the BattleTechWiki project itself: information, policies, guidelines, essays, processes, discussion, etc. Namespace aliases: BTW: or Project:
  • File namespace (prefix File:): contains description pages for media files (images, videos, and audio files). A link starting with [[File: will display the media at that position on the page instead of showing a wikilink that leads to the specified file description page, so if you want the latter effect, use a link beginning with [[:File: (the colon trick). Namespace alias: Image:
  • MediaWiki namespace (prefix MediaWiki:): a namespace containing interface texts, such as the links and messages that appear on automatically generated pages. Pages in this namespace are permanently protected against editing by regular users. For a list of these messages, see Special:AllMessages. (The prefix cannot be shortened to "MW" because mw is an interwiki prefix. See Interwiki links below.)
  • Template namespace (prefix Template:): contains templates – pages that are intended primarily to be transcluded or substituted onto other pages to insert standard text or boxes such as infoboxes and navigation boxes. Namespace alias: TM:
  • Help namespace (prefix Help:): contains pages which provide help in using BattleTechWiki and its software, both for users of the encyclopedia and for editors.
  • Category namespace (prefix Category:): contains category pages, which are curated lists of related pages and subcategories, along with optional additional text. A link beginning with [[Category: has the effect of adding the page the link appears on to the specified category; it will not result in a wikilink to the category page itself. If you want the latter, use the colon trick: [[:Category:.
  • Portal namespace (prefix Portal:): for reader-oriented portals that help readers find articles related to a specific topic, and may contain links to encourage contributions to relevant WikiProjects.
  • Draft namespace (prefix Draft:): hosts drafts of new (potential) BattleTechWiki articles.
  • Module namespace (prefix Module:): contains Scribunto modules – Lua scripts implementing special-purpose parser functions for use in templates, beyond the basic set included with MediaWiki and its extensions.

Custom namespaces[edit]

Namespace numbers between 3000 and 4999 should not be used; these numbers are reserved for wikis to define their own custom namespaces. Furthermore, care should be taken when selecting numbers under 1000, since this range has historically been quite heavily used by extensions and sites alike (numbers under 200 should probably be avoided altogether). On this wiki we have the following "custom" namespaces

Extension namespaces[edit]

In general, extensions should reserve namespace numbers in blocks of 10, where no known namespaces are already added by MediaWiki core or any known extensions. Each block is intended for an extension to use sequentially; in particular, extensions that add more than one custom namespace should not reserve an additional block for each additional namespace, unless the extension has exhausted its current block.

Namespace aliases[edit]

Namespace aliases are alternative names that will also be resolved to other names. Currently on BattleTechWiki, by default, "Image" is an alias for File, so [[Image:MediaWiki-2020-logo.svg]] is equivalent to [[File:MediaWiki-2020-logo.svg]].

In the future we may make the current shortcuts namespace aliases For instance, [[BattleTechWiki:|BattleTechWiki]], where "BTW" is an alias for BattleTechWiki, which is the namespace "BattleTechWiki".

Aliases and pseudo-namespaces[edit]

An alias of a namespace is its namespace. For example, BTW: is BattleTechWiki:, and so [[BattleTechWiki:Page name]] can be abbreviated [[BTW:Page name]]. See Aliases below, for a list of aliases, such as WT: for BattleTechWiki talk:.

A pseudo-namespace is an agreement to create redirect pages named that way, each of which is a shortcut from mainspace to a single page in its namespace. So an alias refers to any page in its namespace, but a pseudo-namespace has far fewer pages than its real namespace. There are a few pseudo-namespace names like H: for Help:, and CAT: for Category:, and these can be discovered below in the section Pseudo-namespaces.

Talk namespaces[edit]

Each of the above namespaces (but not the virtual namespaces and the former Topic: namespace) has an associated talk namespace—these are also known as discussion pages. The talk namespaces are designated by appending the word talk to the namespace name. For example, the talk namespace associated with the user namespace has the prefix User talk:. The talk namespace associated with the article namespace is Talk:.

Most of the pages in the talk namespaces are used to discuss changes to the corresponding page in the associated namespace. Pages in the user talk namespace are used to leave messages for a particular user. The user talk namespace is special in that, whenever a user's talk page is edited, that user will see an orange box saying "You have new messages" on the top of every page that they view until they visit their talk page. By default, logged-in users will see a red notification square and a small orange box on the top right hand corner of the page; IP users will only see a wide orange box spanning the top of the page. For logged-in users, the new-message bar may be disabled in Special:Preferences.)

Virtual namespaces[edit]

In addition to subject namespaces, and their corresponding talk pages, there are two virtual namespaces (without corresponding talk pages) for specialist purposes:

Special[edit]

The Special: namespace consists of pages (called special pages) that are created by the software on demand, such as Special:RecentChanges. These pages can be linked as usual, as with [[Special:RecentChanges]], except when they have parameters. To use parameters, the full URL must be given as an external link. For example, https:https://www.sarna.net/wiki/index.php?title=Special:Recentchanges&days=3&limit=10, which returns the last ten changes in the last three days.

You can create a redirect to a Special page, but the redirect will not be followed automatically.

For a list of special pages, see Special:SpecialPages.

Media[edit]

The Media: namespace can be used to link directly to a file, rather than to the file description page.

Aliases and pseudo-namespaces[edit]

Aliases and pseudo-namespaces are not namespaces in themselves; their main role is to provide handy ways to link to actual namespaces, by providing shortened links.

The main difference between them being the way they work for this purpose; while aliases directly link to namespaces, pseudo-namespaces can only link to other namespaces by using specialist redirect pages in the main namespace called shortcuts. While aliases are also used for shortcuts, this isn't necessary if the pagename is not shortened.

Pseudo-namespaces all actually reside in main namespace; but a pseudo-namespace called Transwiki: exists as a pseudo-namespace before being moved to another namespace.

Pseudo-namespaces[edit]

Apart from BattleTechWiki's regular namespaces and their aliases, and 2 virtual ones, there are several title prefixes appearing in shortcut redirects pointing to frequently-referred-to BattleTechWiki pages. These prefixes are referred to as pseudo-namespaces and include the following:

A more complete list is available at BattleTechWiki:Shortcut § List of prefixes.

Pseudo-namespaces are not in any way recognised by the wiki software; they are purely a community custom. Titles in pseudo-namespaces actually belong technically in the main (article) namespace and are treated as such by the software: they are case-sensitive and appear in search results restricted to the main namespace. An alias is treated like a real namespace, resulting in a search for the pagename in its namespace, but the "pseudo-namespace:pagename" search is in mainspace, not its pseudo-namespace. For example, searching for "H:S" will not search Help.

To learn some of these shortcuts, first follow the pseudo-namespace link above, then follow one of the redirects listed on that page. It will take you to the target, where you then notice any {{shortcut}} boxes to the right of the page, which may also list some additional shortcuts to that same area. By observing these steps repeatedly, you can discover ways to shorten your typing. You will use pseudo-namespace names more often if you are an advanced editor, highly active in many namespaces, or constantly linking to pages that have a pseudo-namespace shortcut.

To understand the appropriateness of redirects of this type, see BattleTechWiki:Cross-namespace redirects. All shortcuts are discoverable by searching for redirects. There is also the category BattleTechWiki redirects.

Namespace-dependent functionality[edit]

The namespace name is a useful variable for searching in and reporting on sets of pages. It is also used to apply features that configure the sets of pages in one namespace differently from another namespace. Using the namespace name MediaWiki can:

  • Search for pages in a particular namespace only.
  • Report on content or changes in content of a namespace.
  • Enable or disable the subpage feature, per namespace.
  • Offer a random article for the mainspace ([[Special:Random]]), or for a namespace [[Special:Random/Namespace]].
  • Change the functionality of [[wikilink]] if it targets the Category namespace or File namespace. Normally wikilinks are activated by the mouse, but [[Category:Pagename]] activates software functionality when the page is saved, and [[File:Page name]] activates software functionality when the page is rendered.
  • Change the functionality of {{pagename}} so that it defaults to the set of pagenames in Template.
  • Tailor edit notices to a particular namespace's edit page, informing an editor of certain aspects about the content of that namespace.
  • Allow templates to behave differently on pages of different namespaces.

The namespace functionality is often visible in the URL, where you will see a namespace number. These are given in the table below.

Subpages are configured for all namespaces except Main, File, MediaWiki and Category namespaces. Subpages are configured in the software by enabling or disabling the subpage feature per namespace. This further extends the function of a namespace by extending the types of pages or topics of pages a namespace can home. For example, talk page /archives are subpages, and they are both namespace searchable and page name searchable from the search box, unlike history pages, which are in no namespace. Another example is in the Template namespace where it is routine to put the documentation in a subpage called /doc.

Random pages are enabled, in the default software configuration, only for the mainspace.

Searching and reporting can operate over the entire database, or they can be limited to a namespace, and so they will offer a list of all the namespaces currently configured. Special:WhatLinksHere also offers a list of namespaces.

Programming[edit]

The 30 namespaces in the English BattleTechWiki are numbered for programming purposes. The prefix for each namespace is generated using the magic word {{ns}}, in the form {{ns:xx}}, as shown in the table below.

Namespace variable Result (namespace name) Namespace variable Result (talk namespace name)
{{ns:-2}} Media
{{ns:-1}} Special
{{ns:0}} (main namespace, returns empty string) {{ns:1}} Talk
{{ns:2}} User {{ns:3}} User talk
{{ns:4}} BattleTechWiki {{ns:5}} BattleTechWiki talk
{{ns:6}} File {{ns:7}} File talk
{{ns:8}} MediaWiki {{ns:9}} MediaWiki talk
{{ns:10}} Template {{ns:11}} Template talk
{{ns:12}} Help {{ns:13}} Help talk
{{ns:14}} Category {{ns:15}} Category talk
{{ns:100}} Policy {{ns:101}} Policy Talk
{{ns:118}} Draft {{ns:119}} Draft Talk
{{ns:126}} {{ns:127}}
{{ns:710}} {{ns:711}}
{{ns:828}} Module {{ns:829}} Module talk
{{ns:1728}} {{ns:1729}}

Alternative variables are available for most namespaces, for example {{ns:talk}}, {{ns:user}}, and {{ns:user_talk}} for {{ns:1}}, {{ns:2}} and {{ns:3}}. The portal namespace is numbered in the 100-plus range, as are all MediaWiki nonstandard namespaces. It is also possible to use {{Namespace name}} for this, i.e. "{{Namespace name|711}}" produces "".

All namespaces with a positive number or zero in this list are searchable. Specifically, the Media and Special namespaces are not searchable.

The magic word {{NAMESPACE}} returns the namespace prefix of the current page. This can be used in combination with other magic words and parser functions to change the appearance of templates depending on the namespace in which they are transcluded.

Meta-templates have been created to simplify this process. These include the simple template {{main other}}, and the more complex and versatile {{namespace detect}}.

For information on changing the appearance of a page or template by namespace based on CSS, see CSS section of Identifying namespaces on the MediaWiki help page.

See also[edit]