Module:Edit button

From the Tesseract Wiki, the wiki for all things Marvel Cinematic Universe
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Module:Edit button/doc. [edit] [history] [purge]
Module:Edit button is required by Module:Infobox.

This module is a helper module to be used by other modules; it may not designed to be invoked directly. See Tesseract:Lua/Helper modules for a full list and more information. For a full list of modules using this helper click here

FunctionTypeUseExample
( [text|'edit'] )stringCreates an edit button for the current page that the module is invoked on

text defaults to "edit"

-- Creates a link that opens the editor screen for whatever page this module is invoked on
 
return function(text)
	local page_title = mw.title.getCurrentTitle().fullText
	local url = tostring(mw.uri.fullUrl(page_title,'action=edit'))
	return '['..url..' '..(text or 'edit')..']'
end