יחידה:Awards

גרסה מ־18:01, 13 בספטמבר 2024 מאת imported>HiyoriX (הפעיל הגנה על הדף "יחידה:Awards": דף בשימוש רב ([עריכה=רק בדוקי עריכות אוטומטית מורשים] (בלתי מוגבלת בזמן) [העברה=רק בדוקי עריכות אוטומטית מורשים] (בלתי מוגבלת בזמן)))
(הבדל) → הגרסה הקודמת | הגרסה האחרונה (הבדל) | הגרסה הבאה ← (הבדל)

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:Awards/תיעוד

local p = {}
local propertyLink = require('Module:PropertyLink')

local prizeCount=0
function counter(v)
	prizeCount=#v
	return v
end

function p.getPrizes(frame)
	local options = {
		['entity-gender-aware'] =  true,
		['qualifiers'] = { 'P585' },
		['allowMulti'] = true,
		['filter'] = counter,
		['seperator'] = '*'
	}
	
	local entityId = frame:getParent().args['qid'] or mw.wikibase.getEntityIdForCurrentPage()
	local res = propertyLink.getPropertyByOptions('P166', entityId, options)
	if prizeCount > 11 then
		res = frame:expandTemplate{ title = 'טורים', args = { ['תוכן'] = res } }
	end
	return res
end

return p