Module:File title list: Difference between revisions
Appearance
hp>Tol main(): remove `args` and replace with either current frame args or parent args |
Humanipedia (talk | contribs) m 1 revision imported |
(No difference)
|
Latest revision as of 21:10, 3 February 2025
Usage[edit source]
{{#invoke:File title list|main}}
To be used in templates, not directly. (It gets parameters from the parent/transcluding template, not passed directly into it.) That parent template's positional parameters will then be output as a list (default bulleted; set type=type
in invoke call for something else; types are from Module:List) of Template:File title formatted links.
list = require('Module:List')
local p = {}
function p.main()
local list_type = mw.getCurrentFrame().args['type'] or 'bulleted'
local list_items = {}
for _, item in ipairs(mw.getCurrentFrame():getParent().args) do
table.insert(
list_items,
'[[:' .. mw.getCurrentFrame():expandTemplate{
title = 'file title',
args = {item}
} .. ']]'
)
end
return list[list_type](list_items)
end
return p