How to set up Mediawiki infoboxes?
-
Mediawiki infoboxes. I'd like to use a Wikipedia-style infobox in my own personal Mediawiki. Help? Please? I must be missing something. I have an installation of Mediawiki on my server that I would like to use for cataloging video games. I like how the better video game entries are set up on Wikipedia (http://en.wikipedia.org/wiki/Crash_Bandicoot), especially the infoboxes. How can I set up similar infoboxes on my wiki? I realize it has to do with templates, but I can't find a clear "dummies" step-by-step on on how to do it. I looked hard. I promise. BONUS: I like http://www.deveria.com/alexis/cvgibmaker.html How can I set up my wiki so the tool will also work with my infoboxes? Thanks!
-
Answer:
It's somewhat tricky, as I remember, because you need to be able to use conditional statements in your templates, which aren't, as such, built into MediaWiki (or at least weren't when I did this.) Right, so then you'll need a couple templates to handle those conditionals: Call:{{{{{}}}|{{{1}}}|{{{2}}}|{{{3}}}}}Ine:{{call|={{{1}}}|{{{2}}}=x0|1={{{2}}}|2={{{3}}}|3={{{4}}}}}X0:<div class="empty_line"><p><br /></p></div>P2p1:{{{2}}}{{{1}}}P2p1p3:{{{2}}}{{{1}}}{{{3}}}Then basically what you do in your template is (I think...): Template:{{#if: {{{VariableName|}}} | VariableName={{{VariableName}}} | VariableName not assigned. }}And then invoke it on your page like:{{Template|VariableName=Whatever}}So for example, take a look at one of the pages on my crappy little wiki, say http://jargonwiki.com/wiki/%40-party. The infobox is on the right. Basically you invoke it on each page through a template, in this case {{Jargon}}:{{Jargon|Term=@-party|Pronunciation=/at180;par`tee/|Usage=[[Grammar:Noun|n.]]|Etymology=[[Etymology:Email|Email]]|Derivation=From the @-sign in an Internet address|Alternate=`@-sign party' /at180;si:n par`tee/|Also=[[boink]]}}Then here's the relevant portion of the {{Jargon}} template:{| style="border:solid #aaa 1px; margin:12px; font-size:120%; background:#ffffcc; width:250px; padding:1em; text-align:left; float:right; clear:right;"|-|<div style="border:0;margin:0;padding-bottom:12px;">{{ #if: {{{Term|}}} | <span style="font-size:150%; font-weight:bold;">'''{{{Term}}}'''</span> | There must be a term. }} {{ #if: {{{Modifier|}}} | <span style="font-size:120%; font-weight:normal;"> - {{{Modifier}}}</span> | }}</div>|-|<div style="padding-left:30px; line-height:100%;">{{ #if: {{{Pronunciation|}}} |{{{Pronunciation}}}|}}{{ #if: {{{Pronunciation-2|}}} |{{{Pronunciation-2}}}<br />|}}{{ #if: {{{Pronunciation-3|}}} |{{{Pronunciation-3}}}<br />|}}{{ #if: {{{Usage|}}} | Usage: {{{Usage}}}<br />|}}{{ #if: {{{Etymology|}}} |Etymology: {{{Etymology}}}<br />|}}{{ #if: {{{Derivation|}}} |Derivation: {{{Derivation}}}<br />|}}{{ #if: {{{Derivation-2|}}} |Alternate: {{{Derivation-2}}}<br />|}}{{ #if: {{{Derivation-3|}}} |Alternate: {{{Derivation-3}}}<br />|}}{{ #if: {{{Synonyms|}}} |''Synonyms:'' {{{Synonyms}}}<br />|}}{{ #if: {{{Antonyms|}}} |''Antonyms:'' {{{Antonyms}}}<br />|}}{{ #if: {{{Also|}}} |''See Also:'' {{{Also}}}<br />|}}</div>|}PITA? Kinda. But it works.
Otis at Ask.Metafilter.Com Visit the source
Other answers
Thanks for the answer...still trying to work on this. Also found some helpful info http://genealogy.wikia.com/wiki/Genealogy:Infobox_templates.
Otis
Related Q & A:
- How To Set Image Generator?Best solution by wiki.openwrt.org
- How To Set Samsung Galaxy Mini?Best solution by att.com
- How To Set Up Proxy Server?Best solution by Super User
- How To Set Cell Background Image In Iphone?Best solution by Stack Overflow
- How To Set Up Website?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.