Module:CharacterInfoboxTitle

local CharacterInfoboxTitle = {} local HF = require("Module:HF")

function main( frame ) local args = frame.args local title = args.Pagename

if not HF.isempty(args.Title) then title = args.Title elseif not HF.isempty(args.CurrentAlias) then title = args.CurrentAlias elseif not HF.isempty(args.CurrentAliasRef) then title = args.CurrentAliasRef elseif not HF.isempty(args.RealName) then title = args.RealName end

local link = ' ' local titleObj = mw.title.new( title )

if type(titleObj) ~= "nil" then if titleObj.exists then link = link .. HF.Link( title, "" ) else link = link .. title end else link = link .. title end

if HF.isempty( field.Death ) then link = link .. HF.CategoryLink( "Living Characters", args.Pagename, "" ) else link = link .. HF.CategoryLink( "Deceased Characters", args.Pagename, "" ) end

return link end

return CharacterInfoboxTitle