Zelda Wiki

Want to contribute to this wiki?
Sign up for an account, and get started!

Come join the Zelda Wiki community Discord server!

READ MORE

Zelda Wiki
Advertisement

Purpose

This module exists so that templates can list an arbitrary number of pages. It is used by notice templates such as Template:Merge.

Usage

{{#invoke:Page List|Main|default= <default>}}

  • default — Default value to display if no pages are specified to the template.

Examples

InputOutputCategories added
{{Merge|Link|Zelda|Ganon}}
TMC Kinstone Piece Artwork 2.png
It has been suggested that this article or section be merged with Link, Zelda and Ganon.

Discuss this on the article's talk page.

{{Merge|Link|Zelda|}}
TMC Kinstone Piece Artwork 2.png
It has been suggested that this article or section be merged with Link and Zelda.

Discuss this on the article's talk page.

{{Merge|Link}}
TMC Kinstone Piece Artwork 2.png
It has been suggested that this article or section be merged with Link.

Discuss this on the article's talk page.

{{Merge}}
TMC Kinstone Piece Artwork 2.png
It has been suggested that this article or section be merged with .

Discuss this on the article's talk page.


local p = {}

local utilsMarkup = require("Module:UtilsMarkup")
local utilsString = require("Module:UtilsString")
local utilsTable = require("Module:UtilsTable")

function p.Main(frame)
	local args = utilsTable.merge({}, frame.args, frame:getParent().args)
	return p.main(args)
end

function p.main(args)
	local default = args.default
	local pages = utilsTable.filter(args, utilsString.notEmpty)
	if #pages == 0 then
		return default
	end
	pages = utilsTable.map(pages, utilsString.trim)
	pages = utilsTable.map(pages, utilsMarkup.link)
	local pageList = mw.text.listToText(pages)
	return pageList
end

return p
Advertisement