MediaWiki/Editing/Advanced

From Bibliotheca Anonoma
Revision as of 20:02, 8 January 2017 by Antonizoon (talk | contribs)

Some advanced features are supported on this wiki.

Creating Infoboxes

Infoboxes on the Bibliotheca Anonoma Wiki are created using Capiunto, a Lua module is relatively easier to install and create infoboxes with than the opaque and puzzling template language. It will take a bit of reading to understand how to make one, but it's worth it.

Basic Usage Guide for Capiunto

Here's an example infobox:

Module:Infobox_Test
local p = {}
 
function p.default(frame)
	local capiunto = require 'capiunto'
	return capiunto.create( {
		top = tostring(mw.title.getCurrentTitle()),
		topStyle = 'background:#cfc;',
		bottom = frame.args["description"]; -- description
	} )
	:addImage(
		string.format('[[File:%s|200px]]', frame.args["img_url"]), -- featured image
		frame.args["caption"] -- caption
	)
	:addRow('URL', frame.args["url"])
	:addRow('Project Status', frame.args["project_status"])
	:addRow('Archiving Status', frame.args["archiving_status"])
	:addRow('Project Source', frame.args["project_source"])
end

return p
MediaWiki/Editing/Advanced
File:Test.png
This image is a test image that is found on Wikimedia Commons.
URL url
Project Status project status
Archiving Status archiving status
Project Source project source
This is a test of the Infobox system. The description would go here: though maybe it should go on the page instead and only semantic data here.

You can then use this infobox with the following method call, and the example appears on the right:

{{#invoke: Infobox_Test | default 
| description      = This is a test of the Infobox system. The description would go here: though maybe it should go on the page instead and only semantic data here.
| img_url          = test.png
| caption          = This '''image''' is a test image that is found on Wikimedia Commons. 
| url              = url
| project_status   = project status
| archiving_status = archiving status
| project_source   = project source
}}