Help:Shared templates
Wikia - creating communities
Contents |
[edit] Template namespace
Templates on the Central Wikia can be used on any other Wikia by using {{wikia:templatename}}.
One advantage of having shared templates on the Central Wikia is that they are watched by a large community, and can be quickly reverted in cases of vandalism.
[edit] List
See list of shared templates for a list of templates aimed at cross-wiki use, or Template:Homewiki for an example.
[edit] Updates
If a template is edited on the original Wikia, the idea is that pages update automatically after purging (by adding ?action=purge to the URL) but that may not (immediately) work.
[edit] Usage and limitations
You can also include pages that are out of the template namespace, but instead of using {{wikia:Template name}} you must use {{wikia::Full page name}} (or {{w::Full page name}} if the last doesn't work). Note that you must put a double colon between wikia (or w) and the full page name (the name of the page with its namespace, like Help:Shared templates)
You must use the correct capitalization. {{wikia:Homewiki}} will work, whereas {{wikia:homewiki}} will not.
Links and variables in shared templates are interpreted as if put on a page in the central wikia, except when substituting the shared template. Thus, when the shared template is included in another wiki, an internal link in the shared template shows up in the style of an internal link, but linking to the central wikia, except when substituting the shared template, in which case the link is an internal link to a local page. A prefix which from the central wikia makes the link an interwiki link, may be a link to the project namespace from the other wiki, and conversely. See peize:Peize:Template sharing demo.
[edit] Editing and translating
Major changes that could have negative effects on other wikis should not be made to any templates here, especially ones on the list of shared templates. However, corrections and improvements that won't prevent the templates from functioning in the way they were originally used are welcome.
Translations are welcome, either at the native name for the template, or as a subpage of the English name, using [[Template:Name/lang code]] format. For example, the Russian version of Template:Wikipedia could go at Template:Википедия or at Template:Wikipedia/ru.
Since these templates will be used on wikis with a wide variety of stylesheets in place, be careful not to add unnecessary styling and formatting to the templates, since this might conflict with the style of the wikis they are used on.
[edit] MediaWiki namespace
The Wikia navigation box in the sidebar makes use of shared messages in the MediaWiki namespace. This means the message is stored in the MediaWiki namespace on the Central Wikia and shared between all Wikia. Unlike other messages in that namespace, shared messages are only editable by admins on the central Wikia.
This feature is still in development, but may now be working for some of the links in the sidebar.
Shared links are added in GlobalSettings.php
$wgWikiaNavLinks[] = array( 'text'=>'wikiahome', 'href'=>'wikiahome-url' ); $wgWikiaNavLinks[] = array( 'text'=>'shared-problemreport', 'href'=>'shared-problemreport-url' ); $wgWikiaNavLinks[] = array( 'text'=>'irc', 'href'=>'irc-url' );
If the message name looks like "shared-[title]", then the system will look for "[title]" in the Mediawiki namespace of the Central Wikia. If the default language of the Wikia (or the language set by a user in their preferences) is not English, then it will search for [[Mediawiki:[title]/langcode]] where langcode is the language code (see supported languages for a list of these). If nothing is found in the language specific subpage, it will use the English version.
For example, on the Chinese WikiMac, the "report a problem" link links to what's on MediaWiki:Problemreport/zh on the Central Wikia. Also, for users with Chinese in their preferences, and for non-logged in users, the link text is the MediaWiki:Problemreport-url/zh content.
This system allows the Wikia news box to be edited and translated from the Central Wikia.