Difference between revisions of "Module:Extension"

Jump to navigation Jump to search
126 bytes added ,  20:51, 16 May 2020
Allow repository name to be passed as a parameter to Template:Extension, useful for extensions whose repo has a different name than the page on MediaWiki.org, like Extension:StructuredDiscussions
>Pppery
(Stop mangling the order of hooks: use the order given as parameters if parameters are provided, and alphabetical order if not)
>Pppery
(Allow repository name to be passed as a parameter to Template:Extension, useful for extensions whose repo has a different name than the page on MediaWiki.org, like Extension:StructuredDiscussions)
Line 177: Line 177:


local function getExtData()
local function getExtData()
local pg = mw.title.getCurrentTitle().rootPageTitle:partialUrl() -- need to get rid of translation subpage.
local pg
local pframe = mw.getCurrentFrame():getParent()
if pframe and pframe.args.repo then
pg = pframe.args.repo
else
pg = mw.title.getCurrentTitle().rootPageTitle:partialUrl() -- need to get rid of translation subpage.
end
return mw.loadData( 'Module:ExtensionJson' )[pg]
return mw.loadData( 'Module:ExtensionJson' )[pg]
end
end
Anonymous user

Navigation menu