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 | local titleObj = mw.title.getCurrentTitle() | ||
local | local args = frame:getParent().args or {} | ||
local booktitle = | local booktitle = args.booktitle | ||
if not booktitle or booktitle == '' then | |||
booktitle = titleObj.text | |||
end | |||
mw.smw.set{ | |||
['Has title'] = booktitle | |||
} | } | ||
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
