Scheduled system upgrade on Sunday 21 April 2024 15:00-16:00 UTC - On that day, the wiki and other services might go down for 5-15 minutes.

Module:For and Template:Archive heading: Difference between pages

From ZeldaMods (Breath of the Wild)
(Difference between pages)
Jump to navigation Jump to search
imported>Leoetlino
m (1 revision imported)
 
imported>BravelyPeculiar
No edit summary
 
Line 1: Line 1:
local mArguments --initialize lazily
<h2>{{#vardefine: path_middle |{{#titleparts: {{PAGENAME}} | -1 | 2 }}}}
local mHatlist = require('Module:Hatnote list')
{{#vardefine: link_text |{{{archive|Content}}}/{{#var: path_middle}}}}
local mHatnote = require('Module:Hatnote')
{{#if: {{#var: path_middle}} | [[Content/{{#var: path_middle}}#{{#var: link_text}}|{{#var: link_text}}]]|[[{{{archive|Content}}}]]}}/{{SUBPAGENAME}}</h2>
local yesNo = require('Module:Yesno')
<noinclude>
local p = {}
<templatedata>
 
{
--Implements {{For}} from the frame
"params": {
--uses capitalized "For" to avoid collision with Lua reserved word "for"
        "1": {
function p.For (frame)
"label": "Archive",
mArguments = require('Module:Arguments')
            "description": "Don't include for unpacked files",
return p._For(mArguments.getArgs(frame))
"type": "string"
end
        }
 
}
--Implements {{For}} but takes a manual arguments table
}
function p._For (args)
</templatedata>
local use = args[1]
[[Category: ZeldaMods templates]]
if (not use) then
</noinclude>
return mHatnote.makeWikitextError(
'no context parameter provided. Use {{other uses}} for "other uses" hatnotes.',
'Template:For#Errors',
args.category
)
end
local pages = {}
function two (a, b) return a, b, 1 end --lets us run ipairs from 2
for k, v in two(ipairs(args)) do table.insert(pages, v) end
return mHatnote._hatnote(
mHatlist.forSeeTableToString({{use = use, pages = pages}}),
{selfref = args.selfref}
) .. (
(use == 'other uses') and yesNo(args.category) and
'[[Category:Hatnote templates using unusual parameters]]' or ''
)
end
 
return p

Revision as of 17:30, 4 April 2019

Content/Archive heading

No description.

Template parameters

ParameterDescriptionTypeStatus
Archive1

Don't include for unpacked files

Stringoptional