Lua error at line 10: attempt to concatenate field '?' (a nil value).
local p = {}
function p.main(frame)
local parentTitle = frame:getParent():getTitle()
if mw.title.getCurrentTitle().prefixedText == parentTitle then
-- we're not being transcluded, so show the content normally
return '== ' .. frame.args[1] .. ' =='
else
-- we're being transcluded, so show links to the sections
return '#[[' .. parentTitle .. '#' .. frame.args[1] .. '|' .. frame.args[1] .. ']]'
end
end
return p