Module:pages/templates

Hello, you have come here looking for the meaning of the word Module:pages/templates. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:pages/templates, but we will also tell you about its etymology, its characteristics and you will know how to say Module:pages/templates in singular and plural. Everything you need to know about the word Module:pages/templates you have here. The definition of the word Module:pages/templates will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:pages/templates, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module implements {{pagetype}}.


-- Prevent substitution.
if mw.isSubsting() then
	return require("Module:unsubst")
end

local export = {}

local en_utilities_module = "Module:en-utilities"

function export.pagetype_t(frame)
	local args = require("Module:parameters").process(frame:getParent().args, {
		 = {type = "boolean"},
		 = {demo = true},
	})
	
	local pagename = args.pagename
	local pagetype = require("Module:pages").get_pagetype(
		pagename == nil and mw.title.getCurrentTitle() or
		mw.title.new(pagename) or
		error(("%s is not a valid page name"):format(mw.dumpObject(pagename)))
	)
	
	return args.article and (
		pagetype:match("^user%f") and "a " .. pagetype or -- avoids "an user"
		require(en_utilities_module).add_indefinite_article(pagetype)
	) or pagetype
end

return export