MediaWiki/Editing/Advanced: Difference between revisions

From Bibliotheca Anonoma
(Created page with "Some advanced features are supported on this wiki. == Creating Infoboxes == Infoboxes on the Bibliotheca Anonoma Wiki are created using mediawikiwiki:Extension:Capiunto|Ca...")
 
No edit summary
Line 31: Line 31:
return p
return p
</nowiki>}}
</nowiki>}}
You can then use this infobox with the following method call, and it appears to the right:


{{#invoke: Infobox_Test | default  
{{#invoke: Infobox_Test | default  
Line 43: Line 41:
| project_source  = project source
| project_source  = project source
}}
}}
You can then use this infobox with the following method call, and the example appears on the right:


{{bc|<nowiki>
{{bc|<nowiki>

Revision as of 20:02, 8 January 2017

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
}}