Anonymous user
Module:Documentation: Difference between revisions
per edit request on talk page - make the doc environment behave correctly, giving the actual template name on the doc page rather than the name of the "doc" subpage
m (1 revision imported) |
(per edit request on talk page - make the doc environment behave correctly, giving the actual template name on the doc page rather than the name of the "doc" subpage) |
||
Line 237: | Line 237: | ||
local title = env.title | local title = env.title | ||
local subpage = title.subpageText | local subpage = title.subpageText | ||
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then | if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') or (subpage == message('doc-subpage') and mw.title.getCurrentTitle().namespace == env.docSpace) then | ||
return mw.title.makeTitle(subjectSpace, title.baseText) | return mw.title.makeTitle(subjectSpace, title.baseText) | ||
else | else | ||
Line 379: | Line 379: | ||
-- Get the text. We start with the opening blurb, which is something like | -- Get the text. We start with the opening blurb, which is something like | ||
-- "This is the template sandbox for [[Template:Foo]] (diff)." | -- "This is the template sandbox for [[Template:Foo]] (diff)." | ||
local text = '' | local text = '__EXPECTUNUSEDTEMPLATE__' | ||
local pagetype, sandboxCat | local pagetype, sandboxCat | ||
if subjectSpace == 10 then | if subjectSpace == 10 then |