ATTENTION! The process of updating WiKi to version Eco 10.0 has begun. Those wishing to participate can find out more Information on our ECO Contribution Wiki Discord.


From Eco - English Wiki

Documentation[edit source]

This module provides the back end functionality of the Template:Description. If the template is passed an item name, this module pulls the item's description from Module:ItemData.

Usage[edit source]

See Template:Description

local p = {}

local Utils = require('Module:Utils')

-- Main entry point for the Module
function p.main(frame)
    -- get args from the Template
    local args = Utils.normaliseArgs(frame)

    -- Check if an item is given, return its description from
    -- Module:ItemData if it item is specified
    if args.item then
        local itemData = mw.loadData( "Module:ItemData" )
        if itemData.items[args.item] == nil then
            return 'None'
        elseif itemData.items[args.item].description == '' then
            return 'None'
            return itemData.items[args.item].description
    -- Check if text was given, return the text if so
    elseif args.text then
        return args.text
    -- Error condition, item and text are not given
        local errormsg = 'Improper usage. Please see [[Template:Description]] for help'
        return errormsg

return p