This module is intended to serve as a disambiguation of sorts for Heroes (hence its historical "about" part in its name, after Template:About). The purpose of this module is to clear up any confusion and direct people to the Hero they may be looking for, it is not to make a statement about whether certain Heroes belong in a group or not. Even loosely related Heroes may be included as a result.
Usage
{{#invoke:NameAbout|main|Name=|Name2=|Name3=}}
Infinitely many NameX parameters can be specified. Do not use Name1.
The module will return Heroes with Name
or Person
values matching the parameters passed. It excludes Heroes that matches the page name when used on a Hero page.
Examples
{{#invoke:NameAbout|main|Name=Robin}}
You may be looking for: |
---|
Robin: High Deliverer Robin: Mystery Tactician Robin: Seaside Tactician Robin: Festive Tactician Robin: Fell Reincarnation Robin: Fell Vessel Robin: Fall Vessel Robin: Fall Reincarnation Robin: Tactful Deliverer |
{{#invoke:NameAbout|main|Name=Black Knight|Name2=Zelgius}}
{{#invoke:NameAbout|main|Name=Lucina}}
You may be looking for: |
---|
Lucina: Future Witness Lucina: Spring Exalt Lucina: Brave Princess Lucina: Glorious Archer Lucina: Future Fondness Marth: Enigmatic Blade Mia: Harmonic Blades |
{{#invoke:NameAbout|main|Name=Veronica}}
The above documentation is transcluded from Module:NameAbout/doc. (edit | history)
local cargo = mw.ext.cargo
local List = require 'Module:ListUtil'
local Util = require 'Module:Util'
local escq = require 'Module:EscQ'.main1
local p = {}
function p.main(frame)
local names = {frame.args["Name"]}
local i = 2
while frame.args["Name" .. i] ~= nil do
names[#names + 1] = frame.args["Name" .. i]
i = i + 1
end
local namelist = table.concat(List.map(names, function (s) return ("'%s'"):format(escq(s)) end), ',')
local listQuery = cargo.query(
'Units=U,MoveTypes=M,WeaponTypes=W,DuoHero=DU,HarmonizedHero=HU',
"U._pageName=page,M.Sort=msort,W.Sort=wsort,IFNULL(CONCAT(U.Name,': ',U.Title),U.Name)=name", {
join = 'U.MoveType=M.WikiName,U.WeaponType=W.WikiName,U._pageName=DU._pageName,U._pageName=HU._pageName',
where = ("(U.Name IN (%s) OR U.Person IN (%s) OR "):format(namelist, namelist) ..
("DU.WikiSecondPerson IN (%s) OR DU.WikiThirdPerson IN (%s) OR "):format(namelist, namelist) ..
("HU.WikiSecondPerson IN (%s) OR HU.WikiThirdPerson IN (%s)) AND "):format(namelist, namelist) ..
("U._pageName!='%s'"):format(escq(mw.title.getCurrentTitle().text)),
groupBy = "U._pageName",
orderBy = "U.Name,IFNULL(IntID,2147483647)",
limit = 5000,
}
)
if #listQuery == 0 then
return ''
end
local cont = mw.html.create('div'):css('margin', '-5px 0 1.5em 0')
local tbl = cont:tag('table'):addClass("wikitable"):addClass("default"):addClass("character-about")
tbl:tag("tr"):tag("th"):css("padding", ".1em .5em"):wikitext("You may be looking for:")
local cell = tbl:tag("tr"):tag("td"):css("padding", "0")
for _, v in ipairs(listQuery) do
local icon = frame:expandTemplate{ title = "UnitType", args = {name = v.page, moveSort = v.msort, weaponSort = v.wsort, size = '60'}}
cell:wikitext(frame:expandTemplate {title = "Tooltip", args = {
'<div style="margin-bottom:7px;margin-left:1px;margin-right:4px;margin-top:4px">' .. icon .. "</div>", v.name}})
end
return tostring(cont)
end
return p