View source for Module:RedirectData
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {}
function p.getRedirectToNamespace(frame)
titleObject = mw.title.getCurrentTitle() -- check if this is a redirect
if titleObject.redirectTarget then
targetNamespace = titleObject.redirectTarget.nsText
return targetNamespace
end
return "Notaredirect"
end
function p.getTalkPage(frame) -- this is code written to check for the criteria to apply {{R to talk page}} - essentially, whether the redirect is outside of, and going into, a talk namespace
titleObject = mw.title.getCurrentTitle() -- check if this is a redirect
if titleObject.redirectTarget then
if not titleObject.isTalkPage then -- the current page is NOT a talk page
if titleObject.redirectTarget.isTalkPage then -- the target page IS a talk page
return "Yes"
end
end
return "No"
000
1:0
Templates used on this page:
- Template:Module other (view source)
- Template:Module rating (view source)
- Template:Ombox (view source)
- Template:T (view source)
- Template:Template link (view source)
- Module:Arguments (view source)
- Module:Effective protection level (view source)
- Module:Message box (view source)
- Module:Message box/configuration (view source)
- Module:No globals (view source)
- Module:RedirectData/doc (view source)
- Module:Yesno (view source)
Return to Module:RedirectData.