Jump to content

Module:Pagination

From Simple English Wikipedia, the free encyclopedia
Revision as of 17:34, 27 May 2025 by Codemini (talk | changes) (Fixing)

Implements {{Pagination}}


local p = {} -- package name
local args = require('Module:Arguments').getArgs
function p.main(args)
previous = args[1] or args.previous or ''
nextEl = args[2] or args.next or ''
prevcolor = args.prevcolor or ''
nextcolor = args.nextcolor or ''
ptm = '<span class="prev-btn" style="background-color:' .. prevcolor .. ';> </span> '
ntm = '<span class="next-btn" style="background-color:' .. nextcolor .. ';> </span>'
hide = args.hide or ''
pntm = '' .. ptm .. '' .. ntm .. ''
 if hide == 'previous' then
 return ntm
 else return pntm
 end
 if hide == 'next' then
 return ptm
 else return pntm
 end
 if previous == '' and nextEl == '' then
 return addWarning('PaginationScriptError: You must provide the link for both the previous and next buttons')
 else return pntm
 end
end
return p