Jump to content

Module:Pagination

From Simple English Wikipedia, the free encyclopedia
Revision as of 07:06, 30 May 2025 by Codemini (talk | changes) (Am getting an unpleasant error)

Implements {{Pagination}}


local p = {}
local function pagination(frame)
local args = frame.args
local prevbtn = args[1] or args.previous
local nextbtn = args[2] or args.next
local msg = { noprevLink = 'no link for the previous button',
nonextLink = 'no link for the next button',
noLink = 'no link for both the previous and next buttons'
}
local help = '([[template:Pagination#Errors|help]])'
pntm = '[[' .. prevbtn .. '|Previous]] [[' .. nextbtn .. '|Next]]'
if prevbtn and nextbtn == '' then
return string.format('<strong class="error">"%s"</strong>', msg.noLink, help) else return pntm
end
end
return p