Forskel mellem versioner af "Modul:Brug Wikidata/sandkasse"

m
sortering
(Tjek for om den ønskede egenskab findes)
m (sortering)
 
require("Modul:No globals")
--local data = mw.loadData("Modul:Brug Wikidata/data")
-- local data = mw.loadData("Modul:Brug Wikidata/data/sandkasse")
local preferred_language = data.preferred_language
local fallback_languages = data.fallback_languages
local statements = mw.wikibase.getBestStatements(the_qid, the_pid)
if statements == nil or #statements == 0 then
if false == mw.wikibase.entityExists(the_pid) then
-- The requested property doesn't exist
error('WWikidata-egenskaben "' .. the_pid .. '" findes ikke')
end
-- No data to fetch
return nil, nil, ''
end
-- TODO Sort if requested
if ( args.sort or "" ) ~= "" then
return nil, nil, "Sort: " .. sort
end
 
end
return '<ul><li>' .. table.concat(output, '</li><li>', 1, number) ..
mere_end_maks .. icon .. '</li></ul>' .. icon .. suffix .. tracking_categories
else
local separator = args.adskil or ', '
-- Sort the statements after snaktype (value, novalue, somevalue) and id
-- This makes it possible to find and group equal values together
-- TODO: Only when the sort-parameter isn't specified.
for key, statement in pairs(statements) do
if statement.mainsnak.snaktype == 'value' then
3.591

redigeringer