Module:Pagination

This is an old revision of this page, as edited by Codemini (talk | contribs) at 17:34, 25 May 2025 (Forgot to add links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Introduction: Pagination primarily contains two buttons, a next and a previous button
local p = {}
function p.pagination(frame)
 args = frame.args
 previous = args[1] or args.previous
 next = args[2] or args.next
function p.main(msg)
 msg = 'PaginationScriptError: You must provide a link for the'
 tmp = '<div id="pagination"><div class="prev-btn">[[' .. previous .. '|Previous]]</div> <div class="next-btn">[[' .. next .. '|Next]]</div></div>'
if previous == '' or next == '' then
 return string.format(error(msg 'previous and next buttons'))
else return tmp
end
if previous == '' then
 return string.format(error(msg 'previous button'))
else return tmp
end
if next == '' then
 return string.format(error(msg 'next button'))
else return tmp
end

end
end
return p