Help:Shared templates

Template namespace
Templates on the Central Wikia can be used on any other Wikia by using the format:  .

This feature is no longer supported, and shared templates may not always work. In particular, you may see error messages in place of the templates, or have problems with templates not updating across Wikia.

List
See Help:list of shared templates for a list of templates aimed at cross-wiki use, or Template:Homewiki for an example.

Usage and limitations
You can also include pages that are out of the template namespace, but instead of using   you must use    (or    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 it's namespace, like )

You must use the correct capitalization. will work, whereas  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.

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 Help: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.