Lua is now available as a templating language on FANDOM as we've backported the Scribunto extension to our version of MediaWiki. This helps us provide users with the ability to create more maintainable templates, and improve the performance of some of our slowest pages.

Lua is a dramatically different coding experience than basic wikitext templates, and resembles a more 'traditional' programming syntax (Lua being based on C) and thus offers two key advantages. First and foremost is that logical functionality – if, else, and while statements along with arrays and variable definition for instance - is built in to the Lua language, making the implementation of basic logic much easier in Lua than the hacky way MediaWiki adds it through extra add-ons and parser functions. Secondly, because Lua is streamlined for logical operations, it is much more technically efficient.

Enabling & Support

Lua is enabled by default on all FANDOM wikis. The general standard Lua libraries along with the specialized Scribunto libraries and InfoboxBuilder are available.

In addition to the documentation linked below, we have a forum board set up here on DEV Wiki to ask questions and get help.


Got a cool example of how Lua is being used on your wiki? Willing to allow other users on FANDOM to tweak your design to meet their wiki's needs? Add a link to the Lua module with a quick description of what the module does!

You could also check out the list of Lua Modules.

Navbox Implementations

These are some Lua implementations for Navboxes:


See also

Start a Discussion Discussions about Lua templating

  • for i,v to take template argument

    3 messages
    • ipairs will not help u. use pairs: for i, v in pairs(args) do mw.log(i, v) end sure, u have to parse names by urself, in order to get c1-cn...
    • I figured it out using for i=1,steps do Thanks for your help
  • Need help with iteration!

    7 messages
    • I probably got it! local p = {} local data = { { ['name'] = "Piccaso", ['dob'] = "&quo...
    • Thanks a lot!