Module:Edit button

From Zeah RSPS - Wiki
Revision as of 08:57, 16 February 2022 by Soulgazer (talk | contribs) (Created page with "-- {{Helper module|name=Edit button|fname1=(text)|ftype1=string|fuse1=Creates an edit button for the current page that the module is invoked on<br><br><code>text</code> 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")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

-- {{Helper module|name=Edit button|fname1=(text)|ftype1=string|fuse1=Creates an edit button for the current page that the module is invoked on<br><br><code>text</code> 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