Help:Main codes

From eagle-rock.org

This page tells about the main codes used in this wiki.
For more specific and elaborate information about editing codes, links are given in most sections.

The Help:Editing page gives an overview of internal and external editing pages and manuals.

Audio & video from files uploaded on this wiki

In the past we have used the OggHandler for this. See Wiki Extension:OggHandler.

There is a new and better extension available now (but maybe not yet installed here).
See Extension:TimedMediaHandler

Categories

Add one or more category to each file that you upload, and to each page that you make. Use main categories for bringing structure in this wiki, and also use other categories that may be less structured.
See Manual:Categories for more detailed information what are main categories and other categories.

Categories are made by adding

    [[Category:Gardening]]

at the bottom of a page (for the category 'Gardening').
It doesn't matter where you put the category code in a page, but for cleanless of your editing page, please put it at the bottom.
To add other categories, simply add a new line, for example

    [[Category:Trees]]

If you want to the category 'Trees' to be a subcategory of the category 'Gardening' then simply add

    [[Category:Gardening]]

to the page that was generated for the Category:Trees.

The software automatically generates pages with alphabetical lists of all subcategories and pages in a category.
See Special pages>Lists of pages>Categories.

Working with the Category Tree

This is a new feature!
  • Add this code <categorytree mode=pages>Category</categorytree> at the bottom of a page and it shows links to all the members of this category. Look at the top of this page where i added this code for the category 'help.'
  • Or add the code {{category tree all|mode=all|alignright=yes|header=|ERW}} at the top of the page, followed by one or more enters, and it creates at the top of the page a box with a header that only opens when you click on it. In this case it shows all subcategories of the category ERW.
  • The special page is called Special:CategoryTree; there you can enter the name of a category and then browse its content.

How categories work

Category pages are not meant to contain content. They are only for editors and users to navigate through the site.
When you add [[Category:China]] to a page (preferably at the bottom), it adds that page to a group or category that contains all pages and files that were also given this [[Category:China]] code.
Then, to keep it orderly, the page Category:China can be given the code [[Category:Nations]]. This makes Category:China a subcategory of [[Category:Nations]].
Therefore, when a page is added to the Category:China, it should not also then get the tag [[Category:Nations]], because that would confuse the Category Tree.

More about categories

Color

Set text color by using:

    <span style="color:#009000"> TEXT </span>

This gives: TEXT

Set background color by using:

    <span style="background:#00FF00"> TEXT  </span>

This generates: TEXT

Set both by using:

    <span style="color:#FFFFFF; background:#FF69B4"> TEXT </span>

Gives: TEXT

Here you find color codes.

Images

Here is the code for an image that is commonly placed at the top of a wiki page:

    [[File:Caraway Koeh-172.jpg|200px|thumb|right|Caraway]]

The file you use needs to have been uploaded to this wiki (click Upload file in the left bar). You must use the prefix 'File:' The above code gives the following result:

Caraway


100px instead of 250px:

Caraway


Without caption:

Caraway Koeh-172.jpg


Without thumb and without caption:

Caraway Koeh-172.jpg


Place a link to an external website to make a clickable image:

    [[File:Caraway Koeh-172.jpg|100px|link=http://en.wikipedia.org
     /wiki/Caraway]]

gives: Caraway Koeh-172.jpg

When you want to make sure that a new section, subsection or paragraph ends below the image, rather than next to it, you place this break code behind the image code.

    <br clear="all"/>

More help for images

Gallery

Example code:

    == Gallery ==
     <gallery caption="" widths="200px" heights="150px" perrow="5">
     File:Water cress seeds.JPG|Watercress seeds
     File:whatever.gif|Text that you want to place as caption
     </gallery>

Of course, instead of ==Gallery== you can use another title.
You can change the parameters in the code. Perrow=5 means that you'll get 5 columns. You have to change the widths and the heights of the frames accordingly.
See Winter garden for an example of a gallery with 5 columns.

Making links

Internal links

Internal links are links to pages on this wiki:
    [[Help:Using Images from Commons]]

Help:Using Images from Commons

You can use another text than the title of the page:
    [[Help:Using Images from Commons|How to work with Common images]]

How to work with Common images

Links to other sections on the page, for example:
    [[#Redirects]]

#Redirects

The following links all go to the page Adam:
    [[Adam]]'s
    [[Adam]]&Eve
    [[Adam]]ic

Adam's
Adam&Eve
Adamic

A link to a category page:
    [[:Category:Plants]]

Category:Plants

A link to an image:
    [[Media:[[File:Tetrahedron.jpg|Tetrahedron.jpg|Tetrahedron]]]]

Tetrahedron

A link to a PDF file on this wiki:
    [[Media:Ark of Noah found.pdf|Ark of Noah found]]

Ark of Noah found

Internal links to sections

To a section on the same page:

    [[#Name of section]]

To a section of another page:

    [[Name of page#Name of section]]

To change the name of the link:

    [[#Name of section|Your changed name]]

Linking to files anywhere in your server or computer

Note: This only works when you have control over the server!
  • Open the file with your browser.
  • Copy the url code.
  • To not clog the text of your page with the long url, use the 'reference' codes to place the url in a footnote or reference. Attach the reference to a part of your text.
  • That url code could look like this:
    file:///C:/Igor%20Strawinsky%20%20%27Symphony%20of%20psalms%20%20
     %282%202%29.mp3
  • Place it in a code like this:
    <ref>file:///C:/Igor%20Strawinsky%20%20%27Symphony%20of%20psalms%20%20
     %282%202%29.mp3</ref>
  • Strawinksky, Symphony of psalms[1]
  • Copy the url from the References or Footnotes section, open a new tab in your browser and paste the file there.
  • You can do this with any file that can be opened with a browser, also with videos or books that you cannot upload to this wiki (but you do need to have control over the server).

External links

External links are links to an external web site or web page.

External link:
    http://mediawiki.org<tt></tt>

http://mediawiki.org

External link with label:
    [http://mediawiki.org MediaWiki]<tt></tt>

MediaWiki

Numbered external link:
    [http://mediawiki.org]

[1]

External links with file icons:
    [http://en.wikipedia.org/wiki/.ogg sound] <tt></tt>

sound
Go here to see which icons are supported

More about links

Lists in columns

    
     <div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
     * [[Borage]]
     * [[Clover]]
     '''L'''
     * [[Linseed]]
     * [[Lupin]]
     * [[Mustard]]
     '''R'''
     * [[Rye]]
     * [[Sunflower]]
     </div>

Gives:

Paragraphs and new lines

  • Indent paragraph:
    : Text

generates:

Text
  • Start paragraph after a white line: Leave one empty line in your editing text.

Example text of line number 1.

Example text of line number 2.

  • Start new line in a paragraph, at the end of line 1 you add:
    <br>

generates:
Example text of line number 1.
Example text of line number 2.

  • Start new paragraph after embedded image or video:
    <br clear="all"/>

Quotes: Wiki codes in text

To add codes to texts, you need to apply the 'Nowiki' button in the standard editing toolbar that shows at the top of each page in edit mode. The button looks like this: Nowiki button in toolbar.GIF
The code that the button generates is:

    <nowiki>Your coded text</nowiki>

You can also put such codes in a grey frame, as you see elsewhere on this page. In order to do this, use the space bar.
Standard for this wiki is to hit the space bar five times for each line.

Text quotes

To add quotes from books or texts, use this method:
Genesis 1:1:

    <blockquote>In the beginning God created the heavens and the earth. 2 Now the earth 
     was formless and empty, darkness was over the surface of the deep, and the Spirit of God was 
     hovering over the waters.</blockquote>

Looks like this:
Genesis 1:1:

In the beginning God created the heavens and the earth. 2 Now the earth was formless and empty, darkness was over the surface of the deep, and the Spirit of God was hovering over the waters.

Redirects

A redirect is a page that automatically redirects the reader's browser to a specified target page. Redirects are used to help users locate information and keep wikis organized, so that multiple names, abbreviations, misspellings, or related topics can all point to the same page.

A redirect is created by the text:

    #REDIRECT[[Name of target page]]

References

The basic concept of the <ref> tag is that it inserts the text enclosed by the ref tags as a footnote in a designated section. The following code must be placed behind the text that you want to place a reference behind. The reference in many cases is a text with a link to an external web page.

     <ref>[url text]</ref> 

You can also make footnotes in this way. In that case the code is:

     <ref>text</ref> 

In both cases the code will generate a numbered link behind the text.

You also need to make a section where the references are placed, like this:

    == References ==
     <references />

Or like this:

    ==Footnotes==
     <references />

For multiple use of the same citation or footnote, you can also use the named references feature, choosing a name to identify the citation, and typing

    <ref name="Something">text of the citation</ref>.

Thereafter, the same footnote may be reused any number of times by typing just

    <ref name="Something" />.
Note: The References section is commonly placed below 'See also' and above 'External links.'

References classes

Sometimes you want to add another section with references, for example you could have one section 'References' and a second section 'Footnotes'.
The code for this is:

    Text<ref group="n">Text of footnote 1</ref>

You create the 'Footnotes' section like this:

    ==Footmotes==
     <references group="n"/>

Sections - order of rank on a page

The following sections should preferably be placed in this order:

  1. Gallery
  2. See also
  3. References (or footnotes)
  4. External links
  5. Comments

Use ==See also== for internal links.
Use ==References== for links and/or notes that are attached to parts of the text of your page.
Use ==Footnotes== for footnotes.
Use ==External links== for a list of links to external websites.

Sub- & Superscript

Subscript:

    H<sub>2</sub>O

gives: H2O

Superscript:

    10<sup>-6</sup> = 1/1.000.000

gives: 10-6 = 1/1.000.000

To generate these codes you can also use two buttons in the enhanced MediaWiki toolbar.

Tables

The following codes show how a table can be made:
    {| class="wikitable" border="1"
     |+ Meaning of colors and symbols
     ! Color!! Meaning!!style="background:Gainsboro" |   !! Symbol!! Meaning
     |-
     | style="background:BurlyWood" | || Sowing ||style="background:Gainsboro" | || 
     Pre || Pre-sowing in pots
     |-
     | style="background:lime" | || Planting ||style="background:Gainsboro" |  || Gre
     || Greenhouse, Cold frame
     |-
     | style="background:pink" | || Harvesting ||style="background:Gainsboro" |  ||
     GrM || Green manure plant
     |-
     | style="background:silver"| || Special treatments ||style="background:Gainsboro"
     |  ||I, II etc. || Months
     |}
Meaning of colors and symbols
Color Meaning Symbol Meaning
Sowing Pre Pre-sowing in pots
Planting Gre Greenhouse, Cold frame
Harvesting GrM Green manure plant
Special treatments I, II etc. Months

More help for tables

Table of contents variables

  • To place the entire table at the right of a page, see below #Templates.
  • To place the TOC elsewhere on the page, use
    __TOC__

where you want the table.

  • To force the table to appear, for example in case you have only three or fewer section heads on that page, use
    __FORCETOC__

anywhere on the page.

  • In case you want no TOC, use
    __NOTOC__.

Templates

You can copy templates from other wikis, or also easily make them yourself.
For example, suppose you want to start each page with: Welcome to Eagle Rock Wiki. We have done our best to provide you with the best possible teaching for your internal-, external- and spiritual growth.
Make a template page on this website with the title: Template:Welcome.
In the text of this page you write the entire welcoming lines. In each new page where you want to insert the welcoming text, you write

    {{Welcome}} 

and the template generates the longer welcoming lines.
In the same way you can add code to the template page.
More info: Mediawiki help for templates

Tags to change template behavior

By default, when a template is transcluded (or substituted), the entire wikitext (code) of the template page gets included in that of the target page. However it is possible to modify that behavior, using tags that specify which parts of the template code are to be included. Here follow the main tags:

  • <noinclude>...</noinclude> – the text between the noinclude tags will not be included when the template is transcluded (substituted), but will be processed on the template's page.
  • <includeonly>...</includeonly> – the text between the includeonly tags will be transcluded (substituted), but will not be processed on the template's own page.
  • <onlyinclude>...</onlyinclude> (not often used) – specifies that nothing on the page except what appears between the onlyinclude tags will be transcluded (substituted).
This help comes from: Help:Template page on Wikipedia

A Comments section on a page

To add a comments section at the bottom of a page, add

    {{Comments}} 

at the bottom of the page, or wherever you want the comments section.

Setting different parameters for comments

In this case you have to add the following code, preferably at the bottom of a page:

     ==Comments==: ''You need to be logged into your Facebook account to  post comments''
     {{#widget:Improved Facebook Comments
     |appID={322309441168104}
     |url={{fullurl:{{PAGENAME}}}}
     |num=5
     |width=650
     }}
  • num=X — this variable determines the number of comments that show on the page before there's a jump link to the rest of the comments. You can decided this on the fly. I think 2 should be minimum, 5 maximum but again, it doesn't affect the functionality.
  • width=x — Is set for 650. Columns that are too wide are hard to read. Too narrow and they waste a lot of space. 650 seems like a reasonable width.
  • You need to be logged into your Facebook account to post comments to Facebook. If you're not logged in, you have the option to use Facebook, Yahoo, AOL or Hotmail. You'll notice that the "Post to Facebook" box is checked by default. A reader could opt to NOT post his comment to Facebook by unchecking this box. As it is, we want them to post to FB to increase our reach so I've set this as the default but the option is there for those who want to opt out of that feature.

Table of Contents placed to the right

To make the Table of Contents box go to the right side of the page, add

    {{TOC right}}

preferably right after the introduction to the page, and before the first section.

Text formatting

Align text. Use 'center', 'right' or 'left'.
    <div style="text-align: center;">Centered text</div>
Centered text
Bold text:
    '''Text'''

Text

Cursive text:
    ''Text''

Text

Underlined text:
    <u>Text</u>
    <u>Text</u>

Text

Strikethrough text:
    <s>Text</s>

Text

Videos

See Manual:Embedding video

Footnotes

  1. file:///C:/Igor%20Strawinsky%20%20%27Symphony%20of%20psalms%20%20%282%202%29.mp3