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 08:13, 26 May 2025 (Fixed). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
function p.pagination(frame)
 args = frame.args
 prevcolor = args.prevcolor or ''
 nextcolor = args.nextcolor or ''
 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>'
 p = '<span id="pagination" ><span class="prev-btn" style="background-color: ' .. prevcolor .. ';>[[' .. previous .. '|Previous]]</span></div>'
 n = '<div id="pagination"><span class="next-btn" style="background-color: ' .. nextcolor .. ';>[[' .. nextEl .. '|Next]]</span></div>' hide = args.hide or ''
 pn = p and n
if previous == '' and nextEl == '' then
 return '<strong class="error">' .. msg .. ' previous and next buttons</strong>'
else
 return pn
end
if hide == 'previous' then
 return n
else
 return pn
end
if hide == 'next' then
 return p
else
 return pn
end

end
return p