Module:InfoboxFangame: Difference between revisions

From Bibliotheca Anonoma
m (Protected "Module:InfoboxFangame": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
No edit summary
Line 8: Line 8:
} )
} )
:addImage(
:addImage(
string.format('[[File:%s|200px]]', frame.args["image"]), -- featured image
frame.args["image"], -- featured image, provide your own wikitext: e.g. [[File:test.png|200px]]
frame.args["caption"] -- caption
frame.args["caption"] -- caption
)
)

Revision as of 00:37, 15 January 2017

This page is a module. It contains no Bibliotheca Anonoma-related information, but should be used as part of other articles or templates. For more information, read wp:Help:Lua.

Please do not experiment with this module; you could ruin all pages using this module. If you want to edit this module, copy the text to Module:Sandbox, edit and test it there, and copy it back when it works.

Click here to edit the documentation page, and feel free to voice your opinion regarding this module.

This infobox module is for internal use by Template:Fangame, which adds to a cargo template. Please use that instead.

Usage

Lua error at line 17: data must be either of type string or number.

{{#invoke: InfoboxFangame | default 
| image          = test.png
| caption        = This '''image''' is a test image that is found on Wikimedia Commons. 
| platform       = Windows, Mac, Linux
| franchise      = Super Mario Bros
| release_date   = 2016-08-01
| takedown_date  = 2016-08-02
| homepage_url   = https://test.url
| community_url  = https://reddit.com/r/community
| download_url   = https://archive.org/details/test
}}

local p = {}
 
function p.default(frame)
	local capiunto = require 'capiunto'
	return capiunto.create( {
		top = tostring(mw.title.getCurrentTitle()),
		topStyle = 'background:#cfc;',
	} )
	:addImage(
		frame.args["image"], -- featured image, provide your own wikitext: e.g. [[File:test.png|200px]]
		frame.args["caption"] -- caption
	)
	:addRow('Platform', frame.args["platform"])
	:addRow('Franchise', frame.args["franchise"])
	:addRow('Release Date', frame.args["release_date"])
	:addRow('Takedown Date', frame.args["takedown_date"])
	:addRow('Mod', frame.args["mod"])
	:addRow('Homepage', frame.args["homepage_url"])
	:addRow('Community', frame.args["community_url"])
	:addRow('Download', frame.args["download_url"])
end

return p