Module:Sandbox/RexxS/Pagetitle

From English Wikipedia @ Freddythechick

This is the current revision of this page, as edited by imported>RexxS at 02:32, 24 September 2020 (rm debug). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
--[[
Pagetitle
--]]

local p = {}

-- subjectpagetitle returns the name of the subject page when invoked from the talk page.
p.subjectpagetitle = function(frame)
	return mw.title.getCurrentTitle().subjectPageTitle.text
end

-- subjectpageid returns the id of the subject page when invoked from the talk page.
p.subjectpageid = function(frame)
	return mw.wikibase.getEntityIdForTitle( mw.title.getCurrentTitle().subjectPageTitle.text )
end

return p