Module:Sandbox/Raph Williams65/Template link ultra

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

local p = {}

function p.main(frame)
 title = frame.args[1]
 if mw.title.new(title).exists == true then
 return '[[Template:' .. title .. '|' .. title .. ']] ([[Template talk:' .. title .. '|talk]]<br />. [[special:WhatLinksHere/' .. title .. '|links]])'
 else
  return '<strong class="error">[[User:RaphTEM/Template link ultra|TemplateLinkUltra]] Error: </strong>' .. title ..  '<strong class="error"> is an invalid template name, please check for alternative spellings.</strong> [[Category:Errors reported by Module:Sandbox/Raph Williams65/Template link ultra]]'
   end
 if title == '' then
  return string.format('<strong class="error">[[User:RaphTEM/Template link ultra|TemplateLinkUltra]] Error: No template name found</strong> [[Category:Errors reported by Module:Sandbox/Raph Williams65/Template link ultra]]')
 end
end
return p