Difference between revisions of "Examples of useful code"

From the Family Tree Forum Reference Library
m
 
(40 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:Help]]
 +
__NOEDITSECTION__
 +
[[image:usetop.jpg]]
 +
 
__TOC__
 
__TOC__
  
 +
==Sections and Headings==
 +
{|
 +
|-valign="top"
 +
|[[image:sections2.jpg|left]]
 +
|
  
CLICK ON [Edit] to see the code.
+
Any page which has more than 4 section headings will automatically generate a contents list.  
  
  
==Alphabetical Contents Lists==
+
If you have fewer than 4 headings or sections, you can use <nowiki>__TOC__</nowiki> to create the contents.
  
1. Each letter has its OWN page:
 
  
[[_A ]]|[[_B ]]|[[_C ]]|[[_D ]]|[[_E ]]|[[_F ]]|[[_G ]]|[[_H ]]|[[_I ]]|[[_J ]]|[[_K ]]|[[_L ]]|[[_M ]]|[[_N ]]|[[_O ]]|[[_P ]]|[[_Q ]]|[[_R ]]|[[_S ]]|[[_T ]]|[[_U ]]|[[_V ]]|[[_W ]]|[[_XYZ]]
+
Sections are created by the use of a number of <nowiki>=</nowiki> either side of the title.
  
2. Links WITHIN the same page:
 
  
N.B. THIS USES THE SECTION HEADINGS SO IT APPEARS IN THE TOC/CONTENTS
+
As well as sorting out the hierarchy of the Contents, the layout and format is also generated.  
  
<div align="center"> [[#A|A]] | [[#B|B]] | [[#C|C]] | [[#D|D]] | [[#E|E]] | [[#F|F]] | [[#G|G]] | [[#H|H]] | [[#I|I]] | [[#J|J]] | [[#K|K]] | [[#L|L]] | [[#M|M]] | [[#N|N]] | [[#O|O]] | [[#P|P]] | [[#Q|Q]] | [[#R|R]] | [[#S|S]] | [[#T|T]] | [[#U|U]] | [[#V|V]] | [[#W|W]] | [[#XYZ|XYZ]]</div>
 
  
If there is nothing else on the page you can use  <nowiki>____NOTOC__ <nowiki>__. This avoids a long vertical list.
+
The more <nowiki>=</nowiki> you use, the smaller the font.
 +
|}
  
If you can't use <nowiki>__NOTOC__ </nowiki> you can do the following:
 
  
'''A'''<span id="A"></span> CREATES THE ANCHOR FOR THE LETTER A
+
'''<nowiki>==Headline== </nowiki>'''
  
'''B'''<span id="B"></span> CREATES THE ANCHOR FOR THE LETTER B
+
Will give you large font and also a horizontal line.
  
etc.
+
This is the standard heading which should be used throughout this Wiki.
<br><br>
 
  
==Code with image for pages under construction==
 
  
[[image:Construction.jpg|center]]
+
'''<nowiki>====Section Heading==== </nowiki>'''
  
 +
Will give you a smaller font.
  
==Displaying images==
+
Also used as standard throughout this Wiki.
  
====One single image====
 
  
name | alignment | size | thumb ''or'' frame | caption
+
'''<nowiki>=====Subsection heading=====</nowiki>'''
<br><br><br><br>
 
====='''1. You can just put in the image'''=====
 
  
It will come out full size and aligned to the left with no border or caption.
+
Will give you an even smaller font.
  
<nowiki>[[image:name of image.jpg]]</nowiki>
 
  
[[image:InitialsA.jpg]]
 
<br><br><br><br>
 
====='''2. You can choose horizontal alignment''' - right, left or center =====
 
  
<nowiki> [[image:name of image.jpg|alignment]] </nowiki>
+
==Alphabetical Contents Lists==
  
[[image:InitialsA.jpg|center]]  
+
See '''[[Using Multiple Images]]''' for using hyperlinked pictures.
<br><br><br><br>
 
====='''3. You can choose the size'''=====
 
  
<nowiki> [[image:name of image.jpg||size]]</nowiki>
 
  
[[image:Construction.jpg|150px]]
+
====1. Each letter has its OWN page====
<br><br><br><br>
 
=====4. To get a frame round your picture=====
 
  
<nowiki>[[image:name of image.jpg|alignment|size|thumb]]</nowiki>
+
When you click on the letter, you will be taken to the selected page.  
 
 
[[image:Construction.jpg|left|200px|thumb]]
 
  
 +
To see the code at work:  [[Surname Directory - A]].
  
  
 +
[[_A ]]|[[_B ]]|[[_C ]]|[[_D ]]|[[_E ]]|[[_F ]]|[[_G ]]|[[_H ]]|[[_I ]]|[[_J ]]|[[_K ]]|[[_L ]]|[[_M ]]|[[_N ]]|[[_O ]]|[[_P ]]|[[_Q ]]|[[_R ]]|[[_S ]]|[[_T ]]|[[_U ]]|[[_V ]]|[[_W ]]|[[_XYZ]]
  
  
  
 +
====2. Links WITHIN the same page====
  
 +
When you click on the letter, you will be taken to the selected section.
  
  
 +
'''To see the code at work:'''  '''[[Places_of_Worship:Sussex|Places of Worship ~Sussex]].'''
  
  
 +
'''N.B. THIS USES THE SECTION HEADINGS SO THAT IT APPEARS IN THE TOC/CONTENTS'''
  
  
 +
<div align="center"> [[#A|A]] | [[#B|B]] | [[#C|C]] | [[#D|D]] | [[#E|E]] | [[#F|F]] | [[#G|G]] | [[#H|H]] | [[#I|I]] | [[#J|J]] | [[#K|K]] | [[#L|L]] | [[#M|M]] | [[#N|N]] | [[#O|O]] | [[#P|P]] | [[#Q|Q]] | [[#R|R]] | [[#S|S]] | [[#T|T]] | [[#U|U]] | [[#V|V]] | [[#W|W]] | [[#XYZ|XYZ]]</div>
  
  
 +
'''Example of the code:''' <nowiki>[[#A|A]]</nowiki>
  
  
 +
<nowiki>#A </nowiki> is the name of the section. By putting |after it you can call the link anything you like.
  
  
 +
If there is '''nothing else''' on the page you can use  <nowiki>____NOTOC__ </nowiki>.
 +
  
 +
This avoids a long vertical list in the contents.
  
  
 +
'''N.B.''' If you do use <nowiki>__NOTOC__ </nowiki> anywhere on the page this overules the <nowiki>__TOC__</nowiki>.
  
  
 +
If you can't use <nowiki>__NOTOC__ </nowiki> on a page because it already uses <nowiki>__TOC__ </nowiki> you can do the following:
  
  
 +
<nowiki>'''A'''<span id="A"></span> This creates the anchor for the letter A</nowiki>
  
=====5. To get a frame and have a caption for the picture=====
 
[[image:Construction.jpg|right|250px|thumb|Work in progress]]
 
<nowiki>[[image:name of image.jpg|alignment|size|thumb|caption]]</nowiki>
 
  
 +
<nowiki>'''B'''<span id="B"></span> This creates the anchor for the letter B</nowiki>
  
  
 +
Then you can use the code <nowiki>[[#A|A]]</nowiki> as above.
  
  
  
 +
==Adding your user name==
  
 +
You can add your own user name by typing <nowiki>~~~</nowiki>
  
 +
'''EXAMPLE:''' [[User:Caroline|Caroline]]
  
'''Warning''' - combining more than one picture with or without text can give very unpredictable results.
+
You can add the date and time after your name by typing <nowiki>~~~~</nowiki>
  
As you will see from the examples on this page you often need to press enter several times in order to get a sensible page layout!!
+
'''EXAMPLE:''' [[User:Caroline|Caroline]] 10:35, 9 April 2008 (UTC)
  
  
  
 +
==Back to top==
  
<br><br><br><br>
+
If a pages gets very long, you should consider using:
  
====More than one image on page====
 
<br><br>
 
  
====='''1. Gallery - small thumbnails''' =====
+
'''<nowiki><div align="right">[[#top|Back to Top]]</div></nowiki>'''  
  
<gallery caption="CONTENTS" widths="200px" heights="50px" perrow="4">
 
Image: WIP2_fr2.jpg|[[World_Index_Page]]
 
Image: Surnames3_fr2.jpg|[[Surname Directory]]
 
Image: Bigbook5_fr2.jpg|The [[Big_Book]] of Genealogy.
 
Image: Census_fr2.jpg|[[Census_Search]]
 
</gallery>
 
<br><br>
 
====='''2. Clickpic - hyperlinked pictures'''=====
 
  
To change the size of clickpx - add xxxpx- before the image name - I think
+
EXAMPLE: [[#top|Back to Top]]
  
And thumb and it looks as thought you have to actually make the image smaller in adavance ...
 
  
[[image:InitialsB.jpg|75px]]
 
[[image:InitialsC.jpg|75px]]
 
[[image:InitialsD.jpg|75px]]
 
[[image:InitialsE.jpg|75px]]
 
[[image:InitialsF.jpg|75px]]
 
[[image:InitialsG.jpg|75px]]
 
[[image:InitialsH.jpg|75px]]
 
[[image:InitialsI.jpg|75px]]
 
[[image:InitialsJ.jpg|75px]]
 
[[image:InitialsK.jpg|75px]]
 
[[image:InitialsL.jpg|75px]]
 
[[image:InitialsM.jpg|75px]]
 
[[image:InitialsN.jpg|75px]]
 
[[image:InitialsO.jpg|75px]]
 
[[image:InitialsP.jpg|75px]]
 
[[image:InitialsQ.jpg|75px]]
 
[[image:InitialsR.jpg|75px]]
 
[[image:InitialsS.jpg|75px]]
 
[[image:InitialsT.jpg|75px]]
 
[[image:InitialsU.jpg|75px]]
 
[[image:InitialsV.jpg|75px]]
 
[[image:InitialsW.jpg|75px]]
 
[[image:InitialsXYZ.jpg|75px]]
 
  
http://www.familytreeforum.com/wiki/images/thumb/5/5c/InitialsA.jpg/75px-InitialsA.jpg
+
==Redirections==
  
[[image:Register_fr2.jpg|75px]]
+
A redirect allows one page to divert to another with the minimum amount of fuss.  
http://www.familytreeforum.com/wiki/images/thumb/d/d6/Register_fr2.jpg/75px-Register_fr2.jpg
 
  
{| height="35px" border="0" cellpadding="15"
+
Redirects are usually used when information has been moved to another location.
|{{clickpic|Parish_Registers| http://www.familytreeforum.com/wiki/images/d/d6/Register_fr2.jpg}}
 
||{{clickpic| Certificate_tutorials| http://www.familytreeforum.com/wiki/images/c/ca/Certs_fr.jpg}}
 
||{{clickpic|World_Index_Page| http://www.familytreeforum.com/wiki/images/3/30/WIP2_fr2.jpg}}
 
|-
 
|}
 
<br><br>
 
  
{| height="35px" border="0" cellpadding="15"
 
|{{clickpic|Parish_Registers| http://www.familytreeforum.com/wiki/images/thumb/5/5c/InitialsA.jpg/75px-InitialsA.jpg}}
 
||{{clickpic| Certificate_tutorials| http://www.familytreeforum.com/wiki/images/thumb/d/d6/Register_fr2.jpg/75px-Register_fr2.jpg}}
 
||{{clickpic|World_Index_Page| http://www.familytreeforum.com/wiki/images/3/30/WIP2_fr2.jpg}}
 
|-
 
|}
 
  
====='''3. Picture on the left, some text and picture on the right'''=====
+
====To make a redirect====
  
 +
*Create a new page
  
N.B. If the image has no "built in" border you need to use |thumb| not |frame|.
+
*Then type: <nowiki>#REDIRECT [[pagename]]</nowiki> (Page name being the name of the page you are linking to).
  
 +
*If you then search for the page you just created as a redirect, you'll be transferred to the page you linked the redirect to.
  
[[Image:Documents_fr2.jpg|left|150px|]]
 
[[image:construction.jpg|right|250px|]]
 
  
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec in enim. Aliquam erat volutpat. Maecenas id nibh ut turpis lobortis commodo. Phasellus sed neque. Proin fringilla euismod libero. Etiam vel lectus. Aliquam dui. Curabitur venenatis molestie neque. Integer mi dolor, gravida at, accumsan eget, fringilla eget, arcu. Suspendisse euismod. Nam et lorem accumsan magna venenatis pellentesque. In et ante. Etiam magna. Cras rutrum mi quis tellus.
 
  
Sed mi eros, lacinia mattis, gravida vel, placerat posuere, lacus. Duis accumsan tincidunt sapien. Morbi sed velit. Etiam quis orci. Donec at velit sed lorem elementum feugiat. Curabitur ut ligula. Quisque in eros. Morbi sed enim id sapien tristique fringilla. Nunc ligula augue, pellentesque ac, nonummy id, semper eget, ante. Sed mi eros, lacinia mattis, gravida vel, placerat posuere, lacus. Duis accumsan tincidunt sapien. Morbi sed velit. Etiam quis orci. Donec at velit sed lorem elementum feugiat. Curabitur ut ligula. Quisque in eros. Morbi sed enim id sapien tristique fringilla. Nunc ligula augue, pellentesque ac, nonummy id, semper eget, ante.
+
==Other Help Pages==
  
 
+
[[image:minibad.jpg]] '''[[:Category:Help|The Wiki Guide]]'''
==Example of colour band for titles==
 
 
 
{| style="width:100%; height:35px" border="0" cellpadding="5"
 
| style="color:white" bgcolor="LightSteelBlue "|'''ENGLISH COUNTIES'''
 
|}
 

Latest revision as of 10:41, 23 April 2008


Usetop.jpg

Sections and Headings

Sections2.jpg

Any page which has more than 4 section headings will automatically generate a contents list.


If you have fewer than 4 headings or sections, you can use __TOC__ to create the contents.


Sections are created by the use of a number of = either side of the title.


As well as sorting out the hierarchy of the Contents, the layout and format is also generated.


The more = you use, the smaller the font.


==Headline==

Will give you large font and also a horizontal line.

This is the standard heading which should be used throughout this Wiki.


====Section Heading====

Will give you a smaller font.

Also used as standard throughout this Wiki.


=====Subsection heading=====

Will give you an even smaller font.


Alphabetical Contents Lists

See Using Multiple Images for using hyperlinked pictures.


1. Each letter has its OWN page

When you click on the letter, you will be taken to the selected page.

To see the code at work: Surname Directory - A.


_A |_B |_C |_D |_E |_F |_G |_H |_I |_J |_K |_L |_M |_N |_O |_P |_Q |_R |_S |_T |_U |_V |_W |_XYZ


2. Links WITHIN the same page

When you click on the letter, you will be taken to the selected section.


To see the code at work: Places of Worship ~Sussex.


N.B. THIS USES THE SECTION HEADINGS SO THAT IT APPEARS IN THE TOC/CONTENTS


A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | XYZ


Example of the code: [[#A|A]]


#A is the name of the section. By putting |after it you can call the link anything you like.


If there is nothing else on the page you can use ____NOTOC__ .


This avoids a long vertical list in the contents.


N.B. If you do use __NOTOC__ anywhere on the page this overules the __TOC__.


If you can't use __NOTOC__ on a page because it already uses __TOC__ you can do the following:


'''A'''<span id="A"></span> This creates the anchor for the letter A


'''B'''<span id="B"></span> This creates the anchor for the letter B


Then you can use the code [[#A|A]] as above.


Adding your user name

You can add your own user name by typing ~~~

EXAMPLE: Caroline

You can add the date and time after your name by typing ~~~~

EXAMPLE: Caroline 10:35, 9 April 2008 (UTC)


Back to top

If a pages gets very long, you should consider using:


<div align="right">[[#top|Back to Top]]</div>


EXAMPLE: Back to Top


Redirections

A redirect allows one page to divert to another with the minimum amount of fuss.

Redirects are usually used when information has been moved to another location.


To make a redirect

  • Create a new page
  • Then type: #REDIRECT [[pagename]] (Page name being the name of the page you are linking to).
  • If you then search for the page you just created as a redirect, you'll be transferred to the page you linked the redirect to.


Other Help Pages

Minibad.jpg The Wiki Guide