View source for Module:RedirectData
Appearance
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"
end
return "Notaredirect"
000
1:0
Return to Module:RedirectData.