Difference between revisions of "Help:MediaWiki basics/Advanced training"

From LIMSWiki
Jump to navigationJump to search
m (Cat.)
(Modified a few sections of templates.)
Line 11: Line 11:
===Templates===
===Templates===


Let's get back to that box with text and a big blue "i" at the top. We call that an "infobox." That's created using the template "[[Template:Ombox|ombox]]". Templates are held in their own special [[Help:Namespaces|namespace]] on the wiki. Open the previously mentioned ombox link in a new tab to learn more about this template. As you review it, you'll notice the parameters that can be associated with this template:
In the [[Help:MediaWiki basics/Intermediate training|previous training section]], we briefly touched on the template. Here's the example we used in that section:
 
{{Listen
| filename    = Accordion chords-01.ogg
| title      = Accordion chords
| description = Chords being played on an accordion
| pos        = left
}}
 
<pre style="overflow: auto">
{{Listen
| filename    = Accordion chords-01.ogg
| title      = Accordion chords
| description = Chords being played on an accordion
| pos        = left
}}
</pre>
 
As we stated, that code is used in relation to the [[Template:Listen|Listen template]]. A template typically contains repetitive material that might need to show up on any number of articles or pages. The most common method of inclusion is called [[LIMSWiki:Transclusion|transclusion]], where the wikitext of the target page contains a reference to the template using the <code><nowiki>{{Template name}}</nowiki></code> syntax. In this case, it's <code><nowiki>{{Listen}}</nowiki></code>, and it includes some modifiable parameters.
 
Now let's get back to that box with text and a big blue "i" at the top. We call that an "infobox." That's created using the template "[[Template:Ombox|ombox]]". Templates are held in their own special [[Help:Namespaces|namespace]] on the wiki. Open the previously mentioned ombox link in a new tab to learn more about this template. As you review it, you'll notice the parameters that can be associated with this template:


<pre>
<pre>
Line 28: Line 48:
</pre>
</pre>


A proper template page will also include documentation on how to use it, so don't feel too overwhelmed. For now, know template formatting is distinct because placing a template in another pages involves placing two opening braces in front (like this: <nowiki>{{</nowiki> ), the name of the template, the desired parameters associated with it, and finally two closing braces in the back (like this: <nowiki>}}</nowiki> ), just as seen in the example above.
A proper template page will also include documentation on how to use it, so don't feel too overwhelmed. For now, know template formatting is distinct because placing a template in another page involves placing two opening braces in front (like this: <nowiki>{{</nowiki> ), the name of the template, the desired parameters associated with it, and finally two closing braces in the back (like this: <nowiki>}}</nowiki> ), just as we've seen in the above examples.


Here are some internal links to pages on this wiki that utilize a variety of different templates. Let's open each page in a new tab and choose the "edit" option to see the code. Then, let's identify all the templates used in those pages:
Here are some internal links to pages on this wiki that utilize a variety of different templates. Let's open each page in a new tab and choose the "edit" option to see the code. Then, let's identify all the templates used in those pages:
Line 50: Line 70:
* Item five uses: [[Template:Infobox laboratory equipment]]; [[Template:Ombox]]; [[Template:Infobox software]]; [[Template:Start date]]; [[Template:Start date and age]]
* Item five uses: [[Template:Infobox laboratory equipment]]; [[Template:Ombox]]; [[Template:Infobox software]]; [[Template:Start date]]; [[Template:Start date and age]]


Notice the wide variety of templates already in use. Looking at a [[Special:Allpages/template:!|complete list of templates]] perhaps makes the topic even more daunting. Don't be afraid; templates have very practical uses and make information presentation more standardized and rapid. As for determining what the most-used templates are on this wiki... that's a more difficult task. However, the sampling above should give you an idea that ombox, citation, infobox, and databox templates are used often.
Notice the wide variety of templates already in use. Looking at a [[Special:Allpages/template:!|complete list of templates]] perhaps makes the topic even more daunting. Don't be afraid; templates have very practical uses and make information presentation more standardized and rapid. As for determining what the most-used templates are on this wiki... that's a more difficult task. However, the sampling above should give you an idea that ombox, citation, infobox, and databox templates are used often in the wiki.
 
For more on templates, consult the relevant [[Help:Contents#Templates|help section]] or the [http://meta.wikimedia.org/wiki/Help:A_quick_guide_to_templates MediaWiki handbook] for more information.


Consult the relevant [[Help:Contents#Templates|Help:Contents]] section or the [http://meta.wikimedia.org/wiki/Help:A_quick_guide_to_templates MediaWiki handbook] for more information.
One final note: honestly, the type of template you're most likely to use on the wiki shouldn't surprise you. Of course, it's the citation template.


===Citations===
===Citations===

Revision as of 00:34, 22 October 2013

Advanced formatting in MediaWiki

Note: When opening links from wiki pages, right-click a link and choose to open it in a new tab. This should make navigating your way through the wiki less complex.

Templates

In the previous training section, we briefly touched on the template. Here's the example we used in that section:

{{Listen
| filename    = Accordion chords-01.ogg
| title       = Accordion chords
| description = Chords being played on an accordion
| pos         = left
}}

As we stated, that code is used in relation to the Listen template. A template typically contains repetitive material that might need to show up on any number of articles or pages. The most common method of inclusion is called transclusion, where the wikitext of the target page contains a reference to the template using the {{Template name}} syntax. In this case, it's {{Listen}}, and it includes some modifiable parameters.

Now let's get back to that box with text and a big blue "i" at the top. We call that an "infobox." That's created using the template "ombox". Templates are held in their own special namespace on the wiki. Open the previously mentioned ombox link in a new tab to learn more about this template. As you review it, you'll notice the parameters that can be associated with this template:

{{ombox
| type  = speedy / delete / content / style / notice / move / protection
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| style = CSS values
| textstyle = CSS values
| text  = The message body text. 
| small = {{{small|}}} / yes
| smallimage = none / [[Image:Some image.svg|30px]]
| smallimageright = none / [[Image:Some image.svg|30px]]
| smalltext  = A shorter message body text.
}}

A proper template page will also include documentation on how to use it, so don't feel too overwhelmed. For now, know template formatting is distinct because placing a template in another page involves placing two opening braces in front (like this: {{ ), the name of the template, the desired parameters associated with it, and finally two closing braces in the back (like this: }} ), just as we've seen in the above examples.

Here are some internal links to pages on this wiki that utilize a variety of different templates. Let's open each page in a new tab and choose the "edit" option to see the code. Then, let's identify all the templates used in those pages:

  1. LIMS vendor
  2. LIMSWiki:Vendor page
  3. 2nd Sight Solutions
  4. National Cancer Institute
  5. LIMSWiki:Product page

After looking in the code for curly braces, we find...

Notice the wide variety of templates already in use. Looking at a complete list of templates perhaps makes the topic even more daunting. Don't be afraid; templates have very practical uses and make information presentation more standardized and rapid. As for determining what the most-used templates are on this wiki... that's a more difficult task. However, the sampling above should give you an idea that ombox, citation, infobox, and databox templates are used often in the wiki.

For more on templates, consult the relevant help section or the MediaWiki handbook for more information.

One final note: honestly, the type of template you're most likely to use on the wiki shouldn't surprise you. Of course, it's the citation template.

Citations

To begin using citations, it's easy to start with a copy/paste of existing citation code. Inline citations are added directly after a piece of information or quote in a body of wiki text.

You'll want to use this page as your initial guide: LIMSWiki:Citation guidelines

It details the citation code you'll use on probably 95 percent of the references you make: Cite web, Cite book, and Cite journal

You can copy code from there, paste it into your edit, and then edit the values of the fields. That page also has links to the original templates in case you need additional attributes not listed in the examples.

Also, it's imperative to include a references section on any page that includes inline citations. Otherwise, pages won't show up properly. You do that by placing the following code:

==References==
<references />