Module:Book: Difference between revisions

From Eli's Software Encyclopedia
mNo edit summary
mNo edit summary
Line 1: Line 1:
local p = {}
local p = {}
local p = {}


function p.semanticStore(frame)
function p.semanticStore(frame)
 
local current = mw.title:getCurrentTitle().fullText
local titleObj = mw.title.getCurrentTitle()
local template = frame:getParent().args
local args  = frame:getParent().args or {}
local booktitle = template.booktitle
local booktitle = args.booktitle
 
local data = {
if not booktitle or booktitle == '' then
['Has title'] = booktitle
booktitle = titleObj.text
end
 
mw.smw.set{
    ['Has title'] = booktitle
}
}
 
mw.smw.set(data)
end
end


return p
return p

Revision as of 11:12, August 19, 2025

Documentation for this module may be created at Module:Book/doc

local p = {}

local p = {}

function p.semanticStore(frame)

	local titleObj = mw.title.getCurrentTitle()
	local args   = frame:getParent().args or {}
	local booktitle = args.booktitle

	if not booktitle or booktitle == '' then
		booktitle = titleObj.text
	end

	mw.smw.set{
    	['Has title'] = booktitle
	}

end

return p