Introducing Lua, for faster and more powerful templates

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.

Hi, everyone! If you don't know me already, I'm Grunny and I'm a software engineer here at Wikia. I'm here to introduce Lua, a new templating language, which we'll be rolling out to all wikias in the near future. This will make it easier for you to create and modify templates such as infoboxes, navigation tables, and many others.

Most of you probably make use of templates on a regular basis. The MediaWiki platform upon which Wikia is built, makes use of special wikitext syntax such as parser functions to let you use logical operations and other features to build templates. The introduction of parser functions effectively turned wikitext into a limited programming language. While parser functions allow you to do many things in templates, complex templates result in performance issues and slow page load times, and are often difficult for users to edit and understand. If you're not sure what parser functions are, then you can see why templates can be complicated!

For this reason, support for Lua as a templating language has been added to MediaWiki, including on Wikia, so you will be able to use a simpler, faster, and more powerful template language. For template editors, Lua will allow you to create a complex template and do things that were either too complex or slow in wikitext. Lua was designed to be relatively easy to learn, and has been successfully used in gaming environments such as World of Warcraft where people with no programming experience have been able to modify their environment by learning a bit of Lua. For those who don't edit templates, you'll still benefit from faster page load times for pages using Lua templates. From converting the character infobox on Marvel Database to Lua, we've seen pages that use it load 35-50% faster!

Lua templates are created by writing the Lua code in the Module: namespace. Then they can be used by adding the parser function {{#invoke:}} to a page or template. As an example of a template that just prints out a greeting to a name passed to it, you might create Module:Greeting with the following content:

Stay tuned for more updates as we roll out Lua templates to more wikias. We'll be posting updates about cool new features, and as we look at enabling it site-wide, we'll be running some training sessions on Wikia Developers Wiki for those who may be interested.