לדלג לתוכן

יחידה:משתמש במאפיינים: הבדלים בין גרסאות בדף

מתוך צפונות ויקי
כיווניות
מאין תקציר עריכה
שורה 4: שורה 4:
local parent = frame.getParent(frame)
local parent = frame.getParent(frame)
local result = ''
local result = ''
local ii = 1
for k,v in pairs(parent.args) do
while true do
local p_num = v or ''
local p_num = parent.args[ii] or ''
if p_num ~= '' then
if p_num ~= '' then
local label = mw.wikibase.label(p_num) or "NO LABEL"
local label = mw.wikibase.label(p_num) or "NO LABEL"
result = result .. "<li><b>[[d:Property:" .. p_num .. "|" .. label ..
result = result .. "<li><b>[[d:Property:" .. p_num .. "|" .. label ..
frame:expandTemplate{title = "כ", args = {}} .. " <small>(" .. string.upper(p_num) .. ")</small>]]</b></li>"
frame:expandTemplate{title = "כ", args = {}} .. " <small>(" .. string.upper(p_num) .. ")</small>]]</b></li>"
ii = ii + 1
else break
end
end
end
end

גרסה מ־21:49, 27 בינואר 2019

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:משתמש במאפיינים/תיעוד

local p = {}

function p.usesProperty(frame)
	local parent = frame.getParent(frame)
	local result = ''
	for k,v in pairs(parent.args) do
		local p_num = v or ''
		if p_num ~= '' then
			local label = mw.wikibase.label(p_num) or "NO LABEL"
			result = result .. "<li><b>[[d:Property:" .. p_num .. "|" .. label ..
				frame:expandTemplate{title = "כ", args = {}} .. " <small>(" .. string.upper(p_num) .. ")</small>]]</b></li>"
		end
	end
	return result
end
 
return p