Help:Wikitext: Difference between revisions

4,455 bytes added ,  5 years ago
no edit summary
No edit summary
No edit summary
Line 649:
|style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
|style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
|}
 
==Files==
{{Main|Help:Files}}
You can add files, such as images and videos, to pages by using a similar syntax to regular links and categories. The file must have already been uploaded to the wiki first; you can check to see if it exists either by [[Help:Searching|searching]] for it, or by going through the [[Special:ListFiles|list of files]]. Files from the [[c:|Wikimedia Commons]] may also be used on this wiki. To use the file, link to the full name of the file as it appears on the wiki or on Wikimedia Commons.
 
{| class="wikitable"
!style="width:34%;"| Description
!style="width:33%;"| You type
!style="width:33%;"| You get
|-
|Using an image at its full size and resolution
|<pre>
[[File:Wikipedia-logo-v2-en.png]]
</pre>
|[[File:Wikipedia-logo-v2-en.png]]
|-
|Using an image in a "thumbnail" format. Basic markup for most images.
|<pre>
[[File:Wikipedia-logo-v2-en.png|thumb]]
</pre>
|[[File:Wikipedia-logo-v2-en.png|thumb]]
|-
|Using an image in a "thumbnail" format with a caption, resizing, and [[wikipedia:alt attribute|alt text]] for use by screen readers.
|<pre>
[[File:Wikipedia-logo-v2-en.png|thumb|250px|The Wikipedia logo|alt=The Wikipedia logo, which consists of a puzzle-piece globe with the words "Wikipedia: The Free Encyclopedia" underneath it.]]
</pre>
|[[File:Wikipedia-logo-v2-en.png|thumb|250px|The Wikipedia logo|alt=The Wikipedia logo, which consists of a puzzle-piece globe with the words "Wikipedia: The Free Encyclopedia" underneath it.]]
|-
|Using an image in a "thumbnail" format, left aligned instead of being right aligned.
|<pre>
[[File:Wikipedia-logo-v2-en.png|thumb|left]]
</pre>
|[[File:Wikipedia-logo-v2-en.png|thumb|left]]
|-
|Linking to an image or file description page without displaying it on the page
|<pre>
[[:File:Wikipedia-logo-v2-en.png]]
[[:File:LotusBud0048a.jpg|Lotus bud]]
</pre>
|
[[:File:Wikipedia-logo-v2-en.png]]<br />
[[:File:LotusBud0048a.jpg|Lotus bud]]
|-
|Linking to an image or file directly without displaying it on the page
|
<pre>
[[Media:Wikipedia-logo-v2-en.png]]
[[Media:LotusBud0048a.jpg|Lotus bud]]
</pre>
|
[[Media:Wikipedia-logo-v2-en.png]]<br />
[[Media:LotusBud0048a.jpg|Lotus bud]]
|}
 
==Templates==
{{Main|Help:Template|Help:Transclusion}}
A template is a page containing text or other forms of wiki markup that are meant to be copied onto other pages automatically. The act of automatically displaying the contents of a page on another page is called "transclusion". Template pages begin with '''Template:''' (note the colon) in their page titles, and are added onto pages by adding the name of the template, surrounded by curly brackets. For example, to transclude the contents of '''Template:Foo bar''' onto a page, edit the page you want to add the template to and add <code><nowiki>{{Foo bar}}</nowiki></code> to the page.
 
Many templates contain parameters which lets you customize how the template appears on the page. Parameters are called by using a vertical bar ({{!}}). If the parameter is unnamed, then you can simply specify the values for the parameter after the vertical bar. Otherwise, if the parameters are named, you must first specify the name of the parameter after the vertical bar, followed by an equal sign ({{=}}), and then the values for the parameter. For example,
 
You can usually find a description of a template's parameters on a template's documentation page, which is usually found when viewing a template page directly. For example, to view the documentation on how to use [[Template:FontColor]] correctly, simply visit that template's page and then scroll to the bottom. The template's documentation is usually contained in a box titled "Template documentation" and contains instructions on how to use the template.
 
{| class="wikitable"
!style="width:34%;"| Description
!style="width:33%;"| You type
!style="width:33%;"| You get
|-
|Transcluding a template, without any parameters
|<pre>
{{Transclusion demo}}
</pre>
|{{Transclusion demo}}
|-
|Transcluding a template using unnamed parameters (see [[Template:FontColor/doc]] for template documentation)
|<pre>
{{FontColor|blue|Text in blue!}}
</pre>
|{{FontColor|blue|Text in blue!}}
|-
|Transcluding a template using named parameters (see [[Template:Wayback/doc]] for template documentation)
|<pre>
{{Wayback |url = http://www.wikipedia.org/ |title = Wikipedia |date = 20010727112808 }}
</pre>
|{{Wayback |url = http://www.wikipedia.org/ |title = Wikipedia |date = 20010727112808 }}
|}