Module:Pagination
Appearance
![]() | This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
Implements {{Pagination}}
Usage
{{#invoke:Pagination|pagination}}
-- 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
nextEl = args[2] or args.next
msg = '<strong class="error">PaginationScriptError: You must provide a link for the</strong>'
tmp = '<div id="pagination"><div class="prev-btn">[[' .. previous .. '|Previous]]</div> <div class="next-btn">[[' .. nextEl .. '|Next]]</div></div>'
if previous == '' and nextEl == '' then
return string.format('<strong class="error">' .. msg .. 'previous and next buttons</strong>')
else return tmp
end
if previous == '' then
return string.format('<strong class="error">' .. msg .. 'previous button</strong>')
else return tmp
end
end
return p