Fandom

Wikia Developers Wiki

ChatInterwikiLinks

889pages on
this wiki
Add New Page
Talk1 Share

ChatInterwikiLinks (CIL) allows you to use interwiki links in chat, such as [[wikipedia:]] and [[mediawikiwiki:]], which can only be linked to as URL links by default.

Syntax

The syntax for an interwiki is the following:

[[prefix:Page Name]]
[[prefix:Page Name|Link text]]

The prefix is the prefix for the interwiki link. The prefix is incase sensitive.

Default values

Installation

First of all, for wiki use, you need to install the custom chat JavaScript and CSS in your wiki. Then import the feature via MediaWiki:Chat.js:

importArticles({
	type: "script",
	articles: [
		"u:dev:ChatInterwikiLinks/code.js"
	]
});

Custom prefixes

You can set define custom interwiki prefixes by placing the following object before the import function:

CustomLinks = {
	custom_prefix_1: "http://example1.com",
	custom_prefix_2: "http://example2.com",
	custom_prefix_3: "http://example3.com"
}

custom_prefix_n is the prefix that would trigger this interwiki link, and its value- the URL followed by it- is the full URL of this wiki, including the protocol (http://).

Note! although when typing a link in chat, the prefix may be case insensitive, the prefix property in the object must be in lowercase.

Disabling default links

You can disable the default links by adding the preventDefault property to the object and by setting it to true. For example:

CustomLinks = {
	custom_prefix_1: "http://example1.com",
	custom_prefix_2: "http://example2.com",
	custom_prefix_3: "http://example3.com",
	preventDefault: true
}

Versions

  • April 2, 2014 - ChatInterwikiLinks is released.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.