Board Thread:2015 - A Year of Community/@comment-4139585-20150802231702

Hello all, and welcome to the first official weekly post. Each Sunday, I (or another admin) will post a thread on a wiki-related topic; this could be anything from a notification of upcoming changes or events, a discussion of a recent problem or trend on the wiki, a tutorial on a Wikia feature that not many users know about, or something else.

That being said, the topic for today is the Wikia Developers Wiki:

The Wiki Developers Wiki is a great resource that everyone can utilize. On this wiki, tech-savvy users write scripts that can be incorporated into individual wikis or for individual users that customize different parts of Wikia's layout or add new features. For example, the w:c:dev:MessageBlock script allows an administrator to send a message to the message wall of a user who is being blocked containing the reason for the block and the duration of the block. There are scripts that all users can use, too, such as the w:c:dev:ChatTags script, which allows for limited customization of chat messages. There are plenty more scripts that you may happen to want to use, so check out their pretty extensive list here.

Now, you may be wondering how to add these scripts so that you may begin using them. Firstly, know that there are three scopes in which scripts may be used:


 * Personal: only an individual user may add this script
 * Co-installable: individual users OR individual wikis may add this script
 * Site-wide: only an individual wiki may add this script (only an admin may add a script)

To add a script that will function across all wikis for just you, first check the scope to make sure it is personal or co-installable. Then, find the necessary page containing the actual script (usually SCRIPTNAME/code.js). Finally, add the following code to w:c:community:Special:MyPage/global.js:

importArticles( {   type: "script",    articles: [        "external:dev:SCRIPTNAME/code.js",        "external:dev:ADDITIONAL/code.js",        "external:dev:SCRIPTS/code.js",        "external:dev:GO/code.js",        "external:dev:DOWN/code.js",         "external:dev:HERE/code.js",       ] });

The only difference for adding a script for sitewide use is that the above code must be added to MediaWiki:Common.js instead of the global.js page. Like I said, only administrators are able to edit this page, as the MediaWiki namespace is permanently protected.

If there are any additional variables necessary for the script, they will be explained on the page for that specific script.

Finally, before these scripts can take effect, you will need to clear your cache. After saving the edits on your global.js page, follow the on-screen instructions about clearing your cache. If the scripts do not work at this point, you may need to wait up to 24 hours for Wikia's cache to be cleared.

I know that this was a very brief overview of customizing your Wikia experience through the use of scripts, so feel free to ask any questions below.

--Paper

 