Module:Pagination and Module:Pagination/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
In accordance with the code at simple english wiki |
I'm looking for a way to make this module to be invoked by others |
||
Line 1: | Line 1: | ||
local p = {} |
local p = {} |
||
local function makeWikitextError(msg) |
|||
local mPagination = require('Module:Pagination').pagination(frame) |
|||
return error(string.format('PaginationScriptError: "%s" ([[template:Pagination#Errors|help]])', msg), 2) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
else return mPagination |
|||
end |
end |
||
⚫ | |||
args = frame.args |
|||
prevcolor = args.prevcolor or '' |
|||
nextcolor = args.nextcolor or '' |
|||
previous = args[1] or args.previous |
|||
nextEl = args[2] or args.next |
|||
p = '<span class="prev-btn" style="background-color: ' .. prevcolor .. ';>[[' .. previous .. '|Previous]]</span>' |
|||
n = '<span class="next-btn" style="background-color: ' .. nextcolor .. ';>[[' .. nextEl .. '|Next]]</span>' |
|||
pn = '' .. p .. ' ' .. n .. '' |
|||
⚫ | |||
return makeWikitextError('no link provided for the previous and next buttons') |
|||
else |
|||
⚫ | |||
end |
|||
end |
end |