Content deleted Content added
m DannyS712 moved page Module:Citeq/sandbox to Module:Cite Q/sandbox without leaving a redirect: requested move; consensus at Module talk:Cite Q |
No edit summary |
||
Line 160:
{{citation}} for rendering.
]]
Line 173 ⟶ 172:
for k, v in pairs (args) do -- copy named parameters and their values into citeq_args
if type( k ) == 'string' then -- numbered parameters ignored
citeq_args[k] = ''; -- set the parameter to empty string; this may be used later to unset authors and editors
else▼
citeq_args[k] = v;
end
end
end
args = frame.args; -- now get frame arguments (presets from wikidata in the
for k, v in pairs (args) do -- copy args into citeq_args
Line 184 ⟶ 187:
elseif 'wdlinks' == k then -- don't copy wdlinks
wdl = v; -- save its value
elseif not citeq_args[k] then --
▲ else
citeq_args[k] = v -- but copy everything else
end
Line 190 ⟶ 193:
if is_set (qid) then
-- if not is_set (citeq_args.author) and not is_set (citeq_args.author1) then -- if neither are set, try to get authors from wikidata
if not (citeq_args['author'] or citeq_args['author1']) then
get_name_list ('author', citeq_args, qid, wdl); -- modify citeq_args table with authors from wikidata
end
-- if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1) then -- if neither are set, try to get editors from wikidata
get_name_list ('editor', citeq_args, qid, wdl); -- modify citeq_args table with editors from wikidata
end
end
return frame:expandTemplate{title = 'citation', args = citeq_args}; -- render the citation
|