Module:ConstructMapName

local Util = require 'Module:Util' local p = {}

function p.construct(frame) local hasTitle = not Util.isNilOrEmpty(frame.args[1]) local hasName = not Util.isNilOrEmpty(frame.args[2]) local hasEpithet = not Util.isNilOrEmpty(frame.args[3]) local isInline = Util.isNilOrEmpty(frame.args[4]) local mapName = "" if hasTitle then mapName = mapName .. frame.args[1] end if hasTitle and hasName then mapName = mapName .. (isInline and ": " or " ") .. frame.args[2] elseif hasName then mapName = mapName .. frame.args[2] end if hasName and hasEpithet then mapName = mapName .. ": " .. frame.args[3] elseif hasEpithet then mapName = mapName .. frame.args[3] end return mapName end return p