יחידה:PropertyLink: הבדלים בין גרסאות בדף

מאין תקציר עריכה
מאין תקציר עריכה
שורה 2: שורה 2:


function p.property(frame)
function p.property(frame)
       
         entity = mw.wikibase.getEntity()
         entity = mw.wikibase.getEntity()
          
          
שורה 35: שורה 34:
          
          
end
end
--use this function to get associated image to be used in the article
function p.imageLink(frame)
    entity = mw.wikibase.getEntity()
    if entity == nil or entity.claims == nil then
            return nil --the entity doesnt exist or have no claims
    end
    property = entity.claims["p18"]
    if property then
        width = frame.args["width"] or "220px"
        property = '[[File:' .. property[0].value ..'|'..width .. ']]'
    end
    return property
end
return p
return p