Jump to content

Module:Pagination

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codemini (talk | contribs) at 17:30, 25 May 2025 (Pagination). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

-- 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 .. '</div> <div class="next-btn">' .. 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