Module:TagList

From Eco - English Wiki
Revision as of 11:43, 13 April 2026 by StalEF (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This module provides the back end functionality of the Template:TagsList.

If the template is passed, this module creates a list using details from the following Modules:


local p = {}

local Utils = require('Module:Utils')
local IconUtils = require('Module:IconUtils')
local Lang = Utils.WikiLang

-- Main entry point for the Module
function p.main()
  
  -- load lists
  local TagData = mw.loadData("Module:TagData")
  local tagList = TagData.tags
  local text = ''
  
  text = '<div class="row">\n'

  for k,v in pairs(tagList) do
            
    if v.IsVisibleInTooltip == 'True' then
        local TagName = v.Name[Lang]
        local tagLink = Utils.VSTranslate("{0} Tag",TagName)
        local tagID = v.ID
            	
        text = text .. '<div class="col-lg-3">\n'
        text = text .. IconUtils.main{ name = TagName, id = tagID, size = 32, style = 2, link = tagLink }
        text = text .. '</div>\n'
		end
    end

    text = text .. '</div>'

  return text
end

return p