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

אין תקציר עריכה
אין תקציר עריכה
שורה 115: שורה 115:
     local property = entity.claims[propertyName]
     local property = entity.claims[propertyName]
     if not property then return end --no such property for this item
     if not property then return end --no such property for this item
   
     property = property[1]
     property = property[1]
    local ref = property.references[referenceID]
--    local ref = property.references --[referenceID]
--return property.mainsnak.datavalue
--    local refValue = ref.datavalue
--  if not refValue then return '' end --reference doesn't exist


    local refValue = ref.mainsnak.datavalue
  -- if refValue['type'] == 'wikibase-entityid' then
    if not refValue then return '' end --reference doesn't exist
--      return mw.wikibase.label( "Q" ..refValue.value['numeric-id'] )
--    elseif refValue['type'] == 'string' then
--      return refValue.value
--   end


    if refValue['type'] == 'wikibase-entityid' then
return ''
        return mw.wikibase.label( "Q" ..refValue.value['numeric-id'] )
    elseif refValue['type'] == 'string' then
        return refValue.value
    end
end
end