Module:ReturnImageForTemplate: Difference between revisions

From Resonite Wiki
m maybe?
fix underscores
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:


function p.ReturnImage( frame )
function p.ReturnImage( frame )
   return frame.args[1] .. frame:getParent().args[1] .. frame.args[2];
   mw.logObject(frame:getParent());
  local i = 1;
  local text = "";
  for i=1, frame.args[3] do
    text = text .. "_" .. frame:getParent().args[i];
  end
 
  return frame.args[1] .. text .. frame.args[2];
end
end


return p
return p

Latest revision as of 22:46, 10 February 2024

Example of how to use this is on Template:GetDirectionNodePage


local p = {}


function p.ReturnImage( frame )
  mw.logObject(frame:getParent());
  local i = 1;
  local text = "";
  for i=1, frame.args[3] do
    text = text .. "_" .. frame:getParent().args[i];
  end
  
  return frame.args[1] .. text .. frame.args[2];
end

return p