Mòdul Discussió:Wikidades: diferència entre les revisions

Contingut suprimit Contingut afegit
Línia 747:
</syntaxhighlight>
--[[Usuari:وهراني|وهراني]] ([[Usuari Discussió:وهراني|disc.]]) 14:41, 11 nov 2020 (CET)
 
{{ping|وهراني}} Ok, I get it. I've tried it in sandbox with a simple hack: [[Special:Diff/25424807]]. The function in defined in the "case" parameter, either in /i18n for other uses or directly on the fly. Note that the parameter passed is the value, not the snak. It works with:
<syntaxhighlight lang="lua">
local myfunc = function(value)
if(tonumber(value) >= 0) then
return '<p style="color:blue">' .. value.. '</code>'
else
return '<p style="color:red">' .. value.. '</code>'
end
end
return require('Module:Wikidades/proves').claim{item='Q799720', property='P2044', case=myfunc}
</syntaxhighlight>
Does this work for you? --[[Usuari:Vriullop|V.Riullop]] ([[Usuari Discussió:Vriullop|parlem-ne]]) 10:31, 12 nov 2020 (CET)
Torna a la pàgina "Wikidades".