Created page with "-- Module:EveryCRTLinks local p = {} function p.addDocumentLink(frame) local crt = mw.title.getCurrentTitle().text -- You can tweak this target naming scheme local target = crt .. " - document" local url = mw.uri.fullUrl( "Special:FormEdit", { form = "Document", target = target, crt = crt } ) return string.format("[%s %s]", tostring(url), "Add a document for this CRT") end return p"
 
No edit summary
 
Line 13: Line 13:
       form = "Document",
       form = "Document",
       target = target,
       target = target,
       crt = crt
 
       -- PageForms prefill syntax:
      ["Document[crt_model]"] = crt
     }
     }
   )
   )

Latest revision as of 21:27, 15 December 2025

Documentation for this module may be created at Module:EveryCRTLinks/doc

-- Module:EveryCRTLinks
local p = {}

function p.addDocumentLink(frame)
  local crt = mw.title.getCurrentTitle().text

  -- You can tweak this target naming scheme
  local target = crt .. " - document"

  local url = mw.uri.fullUrl(
    "Special:FormEdit",
    {
      form = "Document",
      target = target,

      -- PageForms prefill syntax:
      ["Document[crt_model]"] = crt
    }
  )

  return string.format("[%s %s]", tostring(url), "Add a document for this CRT")
end

return p
MediaWiki Appliance - Powered by TurnKey Linux