PDA

View Full Version : I need more wiki help!


Theory?
11-11-2006, 12:56 AM
I have a few questions about MediaWiki formatting, etc.

1) Is it possible to include entires in external websites? For example, I want to use my wiki entires to act as artist profile pages on my website. When people click on the "artists" page and select an artist I'd like their wiki entry to show up on the webiste (instead of linking externally to the wiki).

2) How do I make templates and do all that kind of stuff. http://en.wikipedia.org/wiki/Of_Montreal <---that for example. How do I do that box around the band picture with all the info and stuff like that? Same with the thing at the bottom. How do I do that?

KN
11-11-2006, 09:33 AM
You add templates by creating Template:Name and linking to it like so: {{name}}

Templates can contain variables you may fill in yourself. The Montreal one for example uses this template:

{| class="infobox" style="width: 21em; font-size: 95%;"
|-
! style="text-align: center; background: {{Infobox musical artist 2/color selector|{{{Background|}}} }};" colspan="3" |<big>{{{Name}}}</big>
{{#if:{{{Img|}}}
|<tr style="text-align: center;"><td colspan="3">[[Image:{{{Img}}}|{{#ifeq:{{lc:{{{Landscape|}}}}}|ye s|{{min|300|{{{Img_size|}}}}}x200|{{min|220|{{{Img _size|}}}}}}}px|{{{Img_capt|}}}]] <br /><div style="font-size: 90%; line-height: 15px;">{{{Img_capt|}}}</div></td></tr>
}}
|-
! style="background: {{Infobox musical artist 2/color selector|{{{Background|}}} }};" colspan="3" | Background information
{{#if:{{{Birth_name|}}}
|<tr><td>'''Birth&nbsp;name'''</td><td colspan="2">{{{Birth_name}}}</td></tr>
}}<!--
-->{{#if:{{{Alias|}}}
|<tr><td>'''Also&nbsp;known&nbsp;as'''</td><td colspan="2">{{{Alias}}}</td></tr>
}}<!--
-->{{#if:{{{Born|}}}
|<tr><td>'''Born'''</td><td colspan="2">{{{Born}}}</td></tr>
}}<!--
-->{{#if:{{{Origin|}}}
|<tr><td>'''Origin'''</td><td colspan="2">{{{Origin}}}</td></tr>
}}<!--
-->{{#if:{{{Died|}}}
|<tr><td>'''Died'''</td><td colspan="2">{{{Died}}}</td></tr>
}}<!--
-->{{#if:{{{Genre|}}}
|<tr><td>'''[[Music genre|Genre(s)]]'''</td><td colspan="2">{{{Genre}}}</td></tr>
}}<!--
-->{{#if:{{{Occupation|}}}
|<tr><td>'''Occupation(s)'''</td><td colspan="2">{{{Occupation}}}</td></tr>
}}<!--
-->{{#if:{{{Instrument|}}}
|<tr><td>'''[[Musical instrument|Instrument(s)]]'''</td><td colspan="2">{{{Instrument}}}</td></tr>
}}<!--
-->{{#if:{{{Years_active|}}}
|<tr><td>'''Years&nbsp;active'''</td><td colspan="2">{{{Years_active}}}</td></tr>
}}<!--
-->{{#if:{{{Label|}}}
|<tr><td style="padding-right: 1em;">'''[[Record label|Label(s)]]'''</td><td colspan="2">{{{Label}}}</td></tr>
}}<!--
-->{{#if:{{{Associated_acts|}}}
|<tr><td textalign="top" style="padding-right: 1em;">'''Associated <br /> acts'''</td><td colspan="2">{{{Associated_acts}}}</td></tr>
}}<!--
-->{{#if:{{{Influences|}}}
|<tr><td textalign="top" style="padding-right: 1em;">'''Influences'''</td><td colspan="2">{{{Influences}}}</td></tr>
}}<!--
-->{{#if:{{{URL|}}}
|<tr><td>'''Website'''</td><td colspan="2">{{{URL}}}</td></tr>
}}<!--
-->{{#if:{{{Current_members|}}}
|<tr><th style="background: {{Infobox musical artist 2/color selector|{{{Background|}}} }};" colspan="3">Members</th></tr><tr><td style="text-align: center;" colspan="3">{{{Current_members}}}</td></tr>
}}<!--
-->{{#if:{{{Past_members|}}}
|<tr><th style="background: {{Infobox musical artist 2/color selector|{{{Background|}}} }};" colspan="3">Former&nbsp;members</th></tr><tr><td style="text-align: center;" colspan="3">{{{Past_members}}}</td></tr>
}}<!--
-->{{#if:{{{Notable_instruments|}}}
|<tr><th style="background: {{Infobox musical artist 2/color selector|{{{Background|}}} }};" colspan="3">Notable&nbsp;instrument(s)</th></tr><tr><td style="text-align: center;" colspan="3">{{{Notable_instruments}}}</td></tr>
}}
|}

Note the things with three curly brackets. Those are variables. When you add the template to a page, you fill them in by doing this:

:{{Infobox musical artist
:|Name = Anonymous
:|Img = noimageavailable.jpg
:Img_capt = Anonymous before being pounced by the 4chan party van.
:|Background = solo_singer (this is for categories, hence the underscore. It doesn't show up in the template itself)
:|Born = 2004?
:|Origin = /b/
:|Genre = Desu desu desu
:|Occupation = Nigra
:|Years_active = 2004-present
:|Label = R. C. Mongler
:|URL = <nowiki>[http://www.4chan.org]</nowiki>
:}}

Note that this template is ovenly complex. I never work with anything approaching this scale, thus, I cannot tell you too much about it. I also suck at CSS and Mediawiki's way of doing tables, but there are some handy tools out there that can convert HTML tables to the easier to expand Mediawiki format.

I guess you could get an external page to fetch a Wiki page, but doing so requires some knowledge of PHP. You will either have to find a coder or look around Google. There is no reason why it cannot be done, but I simply don't know how to do it.

Theory?
11-11-2006, 11:27 AM
AH, I do know PHP, so I'll just try some includes or something.

I guess I'll go look up templates.

KN
11-11-2006, 11:36 AM
Few pointers on templates:

If you want to put an explanation in the template that you don't want to see when you actually include the template, use <noinclude></noinclude>

The reverse can also be done, so the entire page can just be the explanation without the actual template getting in the way. Just wrap the actual thing in <includeonly></includeonly>

My suggested use for <includeonly> would be the category. It looks shoddy when templates are included in a category.

Theory?
11-11-2006, 12:18 PM
Yeah I noticed those tags when I was looking up their template for musical artists. They used both tags, I guess just to be safe.

This **** is way too complicated, I don't know how you do it.

KN
11-11-2006, 01:14 PM
The template you're looking at is about 4545 times more complicated than it needs to be. If you can make an html table in Dreamweaver or something, and then feed the source code of that into this (http://diberri.dyndns.org/wikipedia/html2wiki/).

Here's a template that's far easier to comprehend:

{| border=1 align=right cellpadding=4 cellspacing=0 width=250 class="profile"
|+<big>'''{{{name}}}'''</big>
|-
| align=center colspan="2" |
{| style="background:none;" border="0" cellpadding="2" cellspacing="0"
|- align=center
| [[Image:{{{imagename}}}|{{{name}}}]]
|}
|-
| '''Nationality''':
| {{{nationality}}}
|-
| '''Current location''':
| {{{location}}}
|-
| '''ZL(F) position:'''
| {{{job}}}
|-
| '''ZLF join date:'''
| {{{joindate}}}
|}

<includeonly>[[Category:ZLF members]]</includeonly>

The only hard part is the CSS, which you could just leave out so it becomes a simple little table. Note that to add a new row to the table, all you need to add is

|-
|Left side
|Right side

And then either |- for another new row or |} to close the table.

{{{name}}} and such are variables you specify when you add the template to a page, like so:

{{Profile
| name=King Nintendoid
| imagename=Knnewavvie.jpg
| nationality=Dutch
| location=The Netherlands
| job=ZLF supreme leader, Wiki supreme administrator, demi-god
| joindate=06-06-2004
}}

Note the seperator |

This means you don't have to follow this layout. The following would suffice if you were to favour it:

{{Profile|name=King Nintendoid|imagename=Knnewavvie.jpg| nationality=Dutch|location=The Netherlands|job=ZLF supreme leader, Wiki supreme administrator, demi-god|joindate=06-06-2004}}

Theory?
11-11-2006, 01:31 PM
Awesome. That just made it worlds simpler.