Reputation: 9520
I'm managing some data using a mediawiki and am wondering if it is possible to have standardized pages generated from existing wiki data without having to create a load of very similar pages. In an ideal situation, I would have a database backend and page templates dynamically filled by CGI, and I'm wondering if the mediawiki template system can be coerced into filling this role.
This is what I'd like to do:
data page
name: banana
colour: yellow
tastiness: extremely high
extra: some more stuff, potentially with complicated wiki formatting
links: www.banana.com; www.iheartbananas.org
image: banana.jpg
name: apple
colour: red, green
tastiness: variable
extra: some more stuff
links: www.apple-fruit.com
and then for each item in the database, generate a standardized page:
<name> Info
It is generally <colour>
Its tastiness rating is <tastiness>
Read more about <name> at <links>
<image>
Is this possible with mediawiki templates?
Upvotes: 2
Views: 450
Reputation: 28160
It is possible with templates, though it is not necessarily a good solution. You need to create a data template for each item, something like this (say, Template:FruitData/banana
):
{{ {{{template}}}
| name = banana
| colour = yellow
| tastiness = extremely high
| extra = some more stuff, potentially with complicated wiki formatting
| link = www.banana.com
| image = banana.jpg
}}
and a display template (say Template:StandardFruitDisplay
):
[[File:{{{image}}}|thumb|right]]
The {{{name}}} is a {{{colour}}} fruit with {{{tastiness}}} taste. {{extra|}}} See [http://{{{link}}} {{{{link}}}].
and then display it on the actual page like this: {{ Template:FruitData/banana | template = StandardFruitDisplay }}
But you are better of with some data-centric extension, probably (unless your goal is extreme flexibility or user control).
Upvotes: 2