Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Battlestar Wiki:Template List/XML Templates/Instructions: Difference between revisions

From Battlestar Wiki, the free, open content Battlestar Galactica encyclopedia and episode guide
Shane (talk | contribs)
added page; started text
 
Joe Beaudoin Jr. (talk | contribs)
spelling corrections
 
(16 intermediate revisions by one other user not shown)
Line 2: Line 2:


== The XML Document ==
== The XML Document ==
The XML document holds all the templates, sections (categories), and any additional values that many be needed for the website in question, however there are only so many options that the Wikipedia Toolbar can handle.
First of all, the XML document always starts with this line:
<pre>
<?xml version="1.0" encoding="UTF-8" ?>
</pre>
Secondly, everything is always encompassed by:
<pre>
<site>
    ....Everything else....
</site>
</pre>
With these basic elements, you can start putting the basic settings in the XML document.


=== Basic Setup ===
=== Basic Setup ===


==== Overview Object ====
The first "block" that every XML document must have is the '''overview''' block.
 
<pre>
<overall>
<name>Battlestar Wiki</name>
<type>mediawiki</type>
<icon>bsgicon.png</icon>
<lang>en</lang>
</overall>
</pre>
 
* Name - The full name of the wiki
* Type - The type of wiki that it operates.
* Icon - For future
* Lang - The languages installed. Separated by comma's (''',''').
 
=== Lang Setup ===
 
Each language has their own block.
 
<pre>
<en>
            ... Data ...
</en>
</pre>
 
The "overall" block for each language is as follows:
 
<pre>
<en>
<settings>
<fullname>English</fullname>
<loc>http://www.battlestarwiki.org/en</loc>
</settings>
                ... Template & Category Value ...
</en>
</pre>
 
If the host (i.e. http://www.battlestarwiki.org) is not unique for each language when viewing the Wiki, you must enter the "edit" url. For this wiki, and for the English side, the url is located above.
 
== Sections ==
 
To have different sections withing the "popup" menu, follow this format:
 
<pre>
<sections>
<section>
<label>Citations</label>
<area>cit</area>
</section>
<section>
<label>Endnote/Footnote References</label>
<area>endfoot</area>
<parent>cit</parent>
</section>
                        .... More Sections Here ....
</sections>
</pre>
 
* Label - Short Label of the Section
* Area - A '''''unique''''' ID for this section.
* Parent - '''Optional'''; If this is set, this must equal something to <code>area</code> and must be placed after the orginal section is placed. (as shown above).
 
== Templates ==
 
The accual templates is where it gets tricky, and where there can be many options to deal with.
 
This is the first type of template.
 
<pre>
<templates>
<template>
<id>rdmblog</id>
<label>From RDM Blog</label>
<text>{{From RDM blog}}</text>
<cat>cit</cat>
<tooltip>Used to cite RDM's blog.</tooltip>
</template>
                        ... Insert More Template Blocks ...
</templates>
</pre>
 
* ID - Must be a '''''unique''''' ID within the "templates" section..
* Label - A short label.
* Text - The template itself.
* Cat - '''Optional'''; What section it falls under. If this is not put in, it goes in the upper level section that holds the catagories in the first place.
* Tooltip - '''Optional'''; What tooltip will shopw up if you hover your mouse over the template label.
 
Another type of template settings are possaible.
 
This next one is one that has required varabile to fill in.
 
<pre>
<templates>
<template>
<id>tldemo</id>
<label>Template Insert Example</label>
<text>{{tl|%templatecode}}</text>
<cat>dem</cat>
<tooltip>This is meant to print pseudo syntax...</tooltip>
<templatecode>Insert the template name only.|r</templatecode>
</template>
                        ... Insert More Template Blocks ...
</templates>
</pre>
 
* Templatecode - The text that will be displayed in the input box that will popup telling the user, what to enter. The <code>|{r|o}</code> at the end stands for either '''r'''(equired) or '''o'''(ptional) to tell the system on how this variable can be treated. If this is missing, it is assumed that it is optional.


==== Lang Setup ====
Having one "var" in the template creates a unique check system. If text is selected when selecting this template, that selected text will replace the var with no dialog poping up. If there is no text selected, a dialog would popup asking you to input text.


=== Sections ===
A more complex "template" include ones that has muiltiple var's and their could be differences making the required and optionial.


=== Templates ===
<pre>
<templates>
<template>
<id>userdata</id>
<label>User Data</label>
<text>{{User Data|
|photo= %image
|name= %name
|age= %age
|location= %location
|email= %email
|gmail= %gmail
|aim= %aim
|callsign= %callsign
|parents= %parents
|siblings= %siblings
|children= %childern
|marital status= %maritalstatus
|occupation= %occupation
|rank=  %rank
|admin= %admin
}}</text>
<cat>dblocks</cat>
<tooltip>User data block</tooltip>
</template>
                        ... Insert More Template Blocks ...
</templates>
</pre>

Latest revision as of 06:07, 11 March 2007

To help you through the editing of this process this page breaks down the sections of the XML document, and how everything should be formated.

The XML Document

The XML document holds all the templates, sections (categories), and any additional values that many be needed for the website in question, however there are only so many options that the Wikipedia Toolbar can handle.

First of all, the XML document always starts with this line:

<?xml version="1.0" encoding="UTF-8" ?>

Secondly, everything is always encompassed by:

<site>
    ....Everything else....
</site>

With these basic elements, you can start putting the basic settings in the XML document.

Basic Setup

The first "block" that every XML document must have is the overview block.

	<overall>
		<name>Battlestar Wiki</name>
		<type>mediawiki</type>
		<icon>bsgicon.png</icon>
		<lang>en</lang>
	</overall>
  • Name - The full name of the wiki
  • Type - The type of wiki that it operates.
  • Icon - For future
  • Lang - The languages installed. Separated by comma's (,).

Lang Setup

Each language has their own block.

	<en>
            ... Data ...
	</en>

The "overall" block for each language is as follows:

	<en>
		<settings>
			<fullname>English</fullname>
			<loc>http://www.battlestarwiki.org/en</loc>
		</settings>
                ... Template & Category Value ...
	</en>

If the host (i.e. http://www.battlestarwiki.org) is not unique for each language when viewing the Wiki, you must enter the "edit" url. For this wiki, and for the English side, the url is located above.

Sections

To have different sections withing the "popup" menu, follow this format:

		<sections>
			<section>
				<label>Citations</label>
				<area>cit</area>
			</section>
			<section>
				<label>Endnote/Footnote References</label>
				<area>endfoot</area>
				<parent>cit</parent>
			</section>
                        .... More Sections Here ....
		</sections>
  • Label - Short Label of the Section
  • Area - A unique ID for this section.
  • Parent - Optional; If this is set, this must equal something to area and must be placed after the orginal section is placed. (as shown above).

Templates

The accual templates is where it gets tricky, and where there can be many options to deal with.

This is the first type of template.

		<templates>
			<template>
				<id>rdmblog</id>
				<label>From RDM Blog</label>
				<text>{{From RDM blog}}</text>
				<cat>cit</cat>
				<tooltip>Used to cite RDM's blog.</tooltip>
			</template>
                        ... Insert More Template Blocks ...
		</templates>
  • ID - Must be a unique ID within the "templates" section..
  • Label - A short label.
  • Text - The template itself.
  • Cat - Optional; What section it falls under. If this is not put in, it goes in the upper level section that holds the catagories in the first place.
  • Tooltip - Optional; What tooltip will shopw up if you hover your mouse over the template label.

Another type of template settings are possaible.

This next one is one that has required varabile to fill in.

		<templates>
			<template>
				<id>tldemo</id>
				<label>Template Insert Example</label>
				<text>{{tl|%templatecode}}</text>
				<cat>dem</cat>
				<tooltip>This is meant to print pseudo syntax...</tooltip>
				<templatecode>Insert the template name only.|r</templatecode>
			</template>
                        ... Insert More Template Blocks ...
		</templates>
  • Templatecode - The text that will be displayed in the input box that will popup telling the user, what to enter. The |{r|o} at the end stands for either r(equired) or o(ptional) to tell the system on how this variable can be treated. If this is missing, it is assumed that it is optional.

Having one "var" in the template creates a unique check system. If text is selected when selecting this template, that selected text will replace the var with no dialog poping up. If there is no text selected, a dialog would popup asking you to input text.

A more complex "template" include ones that has muiltiple var's and their could be differences making the required and optionial.

		<templates>
			<template>
				<id>userdata</id>
				<label>User Data</label>
				<text>{{User Data|
				|photo= %image
				|name= %name
				|age= %age
				|location= %location
				|email= %email
				|gmail= %gmail
				|aim= %aim
				|callsign= %callsign
				|parents= %parents
				|siblings= %siblings
				|children= %childern
				|marital status= %maritalstatus
				|occupation= %occupation
				|rank=  %rank
				|admin= %admin
				}}</text>
				<cat>dblocks</cat>
				<tooltip>User data block</tooltip>
			</template>
                        ... Insert More Template Blocks ...
		</templates>