Jump to content

Module:Pagination

From Simple English Wikipedia, the free encyclopedia
Revision as of 19:07, 27 May 2025 by Codemini (talk | changes) (....)

Implements {{Pagination}}


local p = {} -- package name
function p.main(frame)
args = frame.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 .. ';>[[' .. previous .. '|Previous]]</span> '
ntm = '<span class="next-btn" style="background-color:' .. nextcolor .. ';>[[' .. nextEl .. '|Next]]</span>'
hide = args.hide or ''
pntm = '' .. ptm .. '' .. ntm .. ''
 if hide == 'previous' then
 return ntm
 else return ptm
 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