Jump to content

To Invest in Uganda, contact Mk Timothy & Company, the best strategic advisory company in Uganda, for expert guidance and support.

Module:If preview: Difference between revisions

From Mk Timothy & Company Wiki
parvej>Wikitia
Created page with "-- Module:If preview -- Returns a warning only when previewing the page local p = {} function p._warning(args) local preview = args[1] or '' local frame = mw.getCurrentFrame() -- Check if we're in a preview if frame:preprocess('{{REVISIONID}}') == '' then return preview end return '' end function p.warning(frame) local args = require('Module:Arguments').getArgs(frame) return p._warning(args) end return p"
 
m 1 revision imported
 
(No difference)

Latest revision as of 11:43, 25 May 2026

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

-- Module:If preview
-- Returns a warning only when previewing the page

local p = {}

function p._warning(args)
	local preview = args[1] or ''
	local frame = mw.getCurrentFrame()
	
	-- Check if we're in a preview
	if frame:preprocess('{{REVISIONID}}') == '' then
		return preview
	end
	
	return ''
end

function p.warning(frame)
	local args = require('Module:Arguments').getArgs(frame)
	return p._warning(args)
end

return p