Creating and using MediaWiki templates?

0

I am trying to create and use the Infobox person template in my own MediaWiki instance. Just copying the base template doesn't work, actually. There must be some underlying thing going on that I am not aware of.

So, how would I go about copying the Wikipedia person Infobox to my own wiki?

ETA: as to the "doesn't work" part, the exact error message that shows up is:

Template loop detected: Template:Infobox person

This is the wiki markup that I saved in "Template:Infobox person"

{{Infobox person
| name        = <!-- include middle initial, if not specified in birth_name -->
| image       = <!-- just the filename, without the File: or Image: prefix or enclosing [[brackets]] -->
| alt         = 
| caption     = 
| birth_name  = 
| birth_date  = <!-- {{Birth date and age|YYYY|MM|DD}} or {{Birth-date and age|Month DD, YYYY}} -->
| birth_place = 
| death_date  = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} or {{Death-date and age|Month DD, YYYY|Month DD, YYYY}} (death date then birth date) -->
| death_place = 
| nationality = 
| other_names = 
| occupation  = 
| known_for   = 
}}

Cyberherbalist

Posted 2013-09-10T06:59:53.407

Reputation: 655

That's certainly not copied code of Template:Infobox person. That's a pattern for using the template. – svick – 2013-09-10T16:01:06.940

@svick: Yep, that's what I was afraid of. I have now used Special:Export/Import and of course what came in was considerably different. It is clear that I am attempting to leap beyond my present knowledge too quickly. I believe that I will have to study MediaWiki more systematically and come up to speed before I start tackling more complex matters like this. Thanks! Accepting your answer. – Cyberherbalist – 2013-09-10T16:12:42.917

Answers

1

“Doesn't work” is not a very useful description of the problem. You should describe what exactly does it do. But what I think the problem is is:

  1. Template:Infobox person uses many other templates, including Template:Infobox. To make it work, you will need those templates too. The easiest way to get all of them is to use Special:Export on Wikipedia and then Special:Import on your wiki.
  2. Template:Infobox uses Module:Infobox, which is written in Lua. To use that, you will need Extension:Scribunto installed on your wiki. If you can't or don't want to use that, you will need to find an older version of the template that doesn't use Lua.

svick

Posted 2013-09-10T06:59:53.407

Reputation: 899

That's a good point about "doesn't work", @svick. I've added what I get and what I've done. I am investigating what you've written here! – Cyberherbalist – 2013-09-10T15:50:42.933

Could you recommend some reference or tutorial resources for working with MediaWiki? I've looked at Amazon.com and there are some books out there, but which is best for a beginner, in your opinion? Or other online sources outside of SuperUser and Wikipedia/MediaWiki itself? – Cyberherbalist – 2013-09-10T16:21:13.357