Module:Carousel and Module:Carousel/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
trim the unnamed parameter |
update to use mw.loadData |
||
Line 11: | Line 11: | ||
-- |
-- |
||
-- The list of filenames is in a named submodule, so everyone can have their own list. |
-- The list of filenames is in a named submodule, so everyone can have their own list. |
||
-- For |
-- For Bishonen (the default), the module is [[Module:Carousel/Shonen]]. |
||
-- For Serial Number 54129, the module is [[Module:Carousel/54129]]. |
-- For Serial Number 54129, the module is [[Module:Carousel/54129]]. |
||
-- See https://en.wikipedia.org/wiki/Special:PrefixIndex/Module:Carousel/ |
|||
-- |
-- |
||
-- {{#invoke:carousel | main | name = name-of-datamodule | switchsecs = number-of-seconds }} |
-- {{#invoke:carousel | main | name = name-of-datamodule | switchsecs = number-of-seconds }} |
||
Line 26: | Line 25: | ||
-- get parameter dataname; if missing, use default |
-- get parameter dataname; if missing, use default |
||
local dataname = frame.args.name |
local dataname = frame.args.name or "" |
||
if dataname == "" then dataname = " |
if dataname == "" then dataname = "Shonen" end |
||
-- there should be a named data module as a submodule |
-- there should be a named data module as a submodule |
||
-- it returns a sequential table of filenames |
|||
local imgs = |
local imgs = mw.loadData("Module:Carousel/" .. dataname) |
||
local numimgs = #imgs |
local numimgs = #imgs |
||