Module:PersonPage: Difference between revisions

From The Seven Sages of Rome
No edit summary
No edit summary
 
Line 6: Line 6:


     if canonicalName and canonicalName ~= '' then
     if canonicalName and canonicalName ~= '' then
        -- Return the redirect
         if frame.args['returnIsRedirect'] == '1' then
         if frame.args['returnIsRedirect'] == '1' then
             return '1'
             return '1' -- Return "true" for the flag check
         end
         end
         return '#REDIRECT [[' .. canonicalName .. ']]'
         return '#REDIRECT [[' .. canonicalName .. ']]' -- The actual redirect output
     end
     end


    -- Return normal behavior
     if frame.args['returnIsRedirect'] == '1' then
     if frame.args['returnIsRedirect'] == '1' then
         return '0'
         return '0' -- Return "false" if no redirect is needed
     end
     end


     return ''
     return '' -- Normal case: no redirect, no output here
end
end


return p
return p

Latest revision as of 17:26, 14 March 2025

Documentation for this module may be created at Module:PersonPage/doc

local p = {}

function p.render(frame)
    local args = frame:getParent().args
    local canonicalName = args['Has Canonical Name']

    if canonicalName and canonicalName ~= '' then
        if frame.args['returnIsRedirect'] == '1' then
            return '1' -- Return "true" for the flag check
        end
        return '#REDIRECT [[' .. canonicalName .. ']]' -- The actual redirect output
    end

    if frame.args['returnIsRedirect'] == '1' then
        return '0' -- Return "false" if no redirect is needed
    end

    return '' -- Normal case: no redirect, no output here
end

return p