Diferencia entre revisiones de «Módulo:Wikidata»

arreglado
permitir pasar argumentos a las funciones
Línea 603: Línea 603:
elseif funcion then
elseif funcion then
local opcionesEntidad = {}
local opcionesEntidad = {}
for k, v in pairs(opciones) do
opcionesEntidad[k] = v
end
     
     
    if mw.ustring.find(opciones['formatoTexto'],'mayúscula', plain ) and  
    if mw.ustring.find(opciones['formatoTexto'],'mayúscula', plain ) and  
Línea 610: Línea 614:
               primera = false
               primera = false
    end
    end
    opcionesEntidad.enlace        = opciones.enlace
    opcionesEntidad.etiqueta      = opciones.etiqueta
    opcionesEntidad['debeExistir'] = opciones['debeExistir']
     
     
    if mw.ustring.find(opciones['formatoTexto'],'cursivas', plain ) then
    if mw.ustring.find(opciones['formatoTexto'],'cursivas', plain ) then
Línea 712: Línea 713:
     marco = frame
     marco = frame
     local args = frame.args
     local args = frame.args
     local valorWikidata = p.getPropiedad( frame.args , nil)
    local parentArgs = frame:getParent().args
   
    -- Copiar los argumentos
    local argumentos = {}
   
    for k, v in pairs(args) do
    argumentos[k] = v
    end
   
    for k, v in pairs(parentArgs) do
    if not argumentos[k] then
    argumentos[k] = v
    end
    end
   
    --if true then return require('Módulo:Tablas').tostring(argumentos) end
   
     local valorWikidata = p.getPropiedad(argumentos, nil)
  local categorias = '';
  local categorias = '';
  local namespace = frame:preprocess('{{NAMESPACENUMBER}}');
  local namespace = frame:preprocess('{{NAMESPACENUMBER}}');