User:Y0 ich halt/Guides/UPG

User pages
Every registered1 user gets their own user page and user talk page, these will be at User:Example and User talk:Example. The standard signature will automatically link to your user page. If you want to create your user page, you can either click the link in your signature if you have already started discussing with other people, or you can click the red link to your user page in the top right user navigation bar, which looks like this:



Please note that i can only give you the instruments to make your user page. It is you who must know what you want there. But if you have any questions for specific coding issues, let me know (on this or on my main talk page) and i'll try to help you.

Before you look at the sections below, remember that there's no actual need of fancy code for nice-looking user pages. Check out Aiiane's page as an example. That's not much code or color and yet it looks pretty good.

1 It is possible for unregistered users (interenet IPs) to have user pages, too, but these will be deleted shortly after creation.

What you should avoid
The user page policy lists some limits to what you may do on your user page:

"Your main user page is the primary page that other users will use to access your user space and to contact you. An excessively long or large page can be an inconvenience to others who just want to get to your talk page.

''The combined contents on your main user page should not exceed 300 kB in total size. You can verify your page size simply by saving your user page with your browser and checking the resulting file size. Note that some browsers do not save the images used on the page, so you need to manually add the file sizes of any images to the file size of your user page.''"

Don't worry. As long as you don't store massive amounts of images on your page it should be hard to get to 300kb size. To help you estimate your page's size, have a look at mine. That page with all its code and text has a total size of roughly 244kB, with around 150kB coming only from the images used.

Basic design elements
The most basic elements are:
 * Tables
 * Divisions
 * Lists (which are normal editing stuff, so I won't explain them here, see Help:Editing)

Tables
Well, I am quite sure you know what a table is. What you might not know is how to build one in Wikicode. I'll explain the most important parts here. If you want to get more information and see some examples, check the table help at MediaWiki.

Basic table tags
What you see here is itself a table. I think it's self-explanatory once you see the code, so here it is (I took out some parts to focus on the important info):

What's most important to note is that every table tag is at the beginning of a new code line. All code after a cell tag will be in this cell - you can even use (code) line breaks - until the next cell starts or until there's a (table) line break tag (see below). It's also possible to put another table inside a cell.

All cells, be it head or normal, are in one line of the table until you add a break to start a new line. You may write several head cells on one code line (so the code itself looks more like the displayed table) separated by double exclamation marks and several normal cells separated by double pipes, like in the following example. You will also notice that in one column, all cells are adjusted to the width of the widest cell in that column.

Basic table formatting
First of all, see the formatting section on what formatting is.

Here you can see where you put your formatting in general:

Note: The line break does not get a pipe behind its formatting, all other cells do.

To give at least one example, let's look at the table from above again:



Advanced table formatting
Apart from the formatting mentioned below, tables have some special attributes: cellspacing, cellpadding, colspan and rowspan.

cellspacing will add or remove (cellspacing=0) spacing between cells. cellpadding will add a space between border and content in each cell. There's a template which will make your table have normal borders and cellspacing. You can use it by inserting  (stands for standard table) after the table begin tag.

colspan and rowspan can extend a cell so it uses space from several cells. Here's an example:

Now this looks strange. Let's analyze it to find the bug:

The very first row sets row length to 4 cells. The second row keeps in line with that, however, it extends the first cell (the one with rowspan="2") into the row below, adding two cells there (colspan="2"). So the third row has a total of six cells, breaking the whole layout. To fix it we can either remove two cells from line three or add two cells to the other lines.

Divisions
A division is simply put a rectangular space. The wiki will automatically add a line break after this space. So, what the hell does that help? You can change background color, border, text formatting, everything inside this space. So they will be your graphical main element.

How to create a division:

The division begins with a  and ends with a. Everything inside these two tags - tables, other divisions, text, images, etc. - will appear inside the space. The space is extended automatically to fit its content. You can also just set its size yourself (see below) (exception: some browsers do not extend the division's height to fit images, since they interpret images as normal text which has a height of a line).

My user page is made almost only of divisions, for example (one huge div in the background, covering the whole page, and many smaller divs with the text in them, the navigation bar is a table that aligns divisions). You will notice a  there. If you have a look at User:y0 ich halt/Style, you will find out that's where I stored all the background, border and padding info.

Here are some more examples what a division can look like:

Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space

(text)

Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space

(text)

Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space - Text to fill space

(text)

or

(text)

Formatting
Formatting is that stuff which makes your page look good. The basic code (syntax) is:   or  . (Note that some attributes don't even have more than one parameter. Some can even go without inverted commas. The terms I'm using here are not correct xhtml terms, but I think they show what's meant.)

Most important attributes:
 * style
 * class
 * width
 * height

width and height
These two accept values like "100px" or "5em". You can also set them to a percentage of the maximum space they could fill with "43%". Numbers only ("5") will be interpreted as 5px.

class
Every wiki can have classes. A class is a formatting template that stores several attributes. This way, you don't have to type out everything and everyone can change the looks in their monobook.css. What this monobook is will not be explained in this guide. (Let's just say it's your personal style storage for the whole wiki.) An example on this wiki is the class "skill-box Warrior". classes exist for all kinds of html-elements: tables, divisions and spans; even plain breaks or paragraphs can have classes.

An example of a division with a class:

''Lorem ipsum dolor sit amet consectetuor omnes, raritat magnibus et in verime operite fundum. Solorlolroflroflroflol olol (This is nonsensical text just to fill some space so you see what it will look like with content. This is called "blind text"; "Lorem ipsum" is a synonym since that's the first two words. The original text which blind text is derived from was latin, a letter from Cicero afaik.)''

Lorem ipsum and much more text

As you can see, the class "profession-bg Warrior" contains information that adds a warrior icon to the background (who would've expected that from a class called "profession background"?)

You can see all classes that exist on this wiki and what they contain at MediaWiki:Common.css.

There's also some standard classes which aren't listed there because they are part of general html:


 * plainlinks (a class for  tags; will remove the little icon that indicates external links)
 * expandable (a class for tables; will collapse the whole table and add a button " [show] " to expand the table, just like the table of contents here)
 * collapsible (the counterpart to "expandable"; will show the table on start but make it collapsible)
 * I'm sure there's more, but that's the most important I think

style
This is by far the most versatile attribute. You can put almost everything in here. Classes (read above) are actually just shortcuts for long style attributes.

The most important style parameters:
 * width: xyz px; - This is the same as the attribute "width"
 * height: xyz px; - Same as attribute "height"
 * background-color: #ABCDEF; - The background color. The value is either an rgb-code or a color keyword like red, blue, green, orange, navy, lavender,... (see User:Barek/color-codes for a huge list)
 * border: xyz px solid #ABCDEF; - Border. It can contain the border's size, color and type (solid, dashed, dotted, groove). The order doesn't matter.
 * padding: xyz px; - Distance between border and content. You can add a padding for only one side with the parameters padding-top, padding-bottom, padding-right and padding-left.
 * margin: xyz px; - Distance of the element to other elements. You can add margins to sides separately like paddings (margin-left etc).
 * text-align: center/left/right; - Self-explanatory.

Example
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

  (text) (-moz-border-radius rounds the corners, doesn't work in Internet Explorer; float is alignment of the whole box)

Intermission
Before reading on, experiment with the stuff above, if you haven't already. If you came from here, read on from there. It's important that you know your way around the basic stuff before you can go and start with more advanced coding.

Just as a guideline, you should not need to read anything below if these three points match you:
 * You could make a table like the Treasure record template yourself.
 * You could make warning boxes yourself.
 * You could make a navigation bar yourself.

As a start, you could make a table with your characters' names, professions and levels.

Finding the right color
To make your user page look really nice, it can be of help to decide on a color scheme which suits you or which you like especially. As you can see on my user page, I've decided on a grayish color scheme. Originally, I wanted to use the color "lavender" and darker tones, but that kinda failed... :D

When you design pages for characters, there's a nice color template for each profession that will save you much work:  (replace x by the profession short, like w, mo, me,...). Put them in the place of a color code like this:.

There are also color words that you can use. A list can be found on Barek's page.

Otherwise you'll have to use rgb color codes (rgb stands for "red green blue"). Some codes:  is red,   is green and   is blue. is orange. #AFAFC3 is the background color for text on my user page.

These codes consist (preceded by a sharp) of three hexadecimal values, the first one indicating the amount of red, the second one green and the third one blue. Each value is represented by two digits, which reach from 0 to 15 (0-9, then a for 10, b for 11, etc. Whether you use upper- or lower-case doesn't matter). This means each color can have a total value of 255 (hexadecimal FF), while 00 is the darkest and FF the lightest. Again, user page example: #AFAFC3 is AF (10x16+15= 175) for red, AF for green and C3 (12x16+4=195) for blue, which means it will be a light color tending to blue since that has the highest value. There are color code generators where you can test out color codes and look for other codes which fit yours.

To actually get different tones of the same color, you need to calculate the values. You pick one to start out, for example: #ACF (which is, btw, the monk color; i'm using only three digits because it's easier to calculate. #ACF is the same as #AACCFF). This is a rather bright tone, so you may wanna use it as a background later on. Now we need a very dark tone for borders. For this, we just lower1 each value by the same, for example 7, and we get (a-7=3,...) #357. This can already be enough to make a whole user page, but just in case, we'll look for a tone inbetween: #8AC. These three codes give a blue color scheme: #ACF, #8AC and #357.

1 For hexadecimal codes, you count 0, 1, 2, 3, ..., 8, 9, a, b, c, d, e, f. This means a = 10, b = 11, ..., f = 15.

Structuring your space
Many people have a navigation bar for their user space. If you browse through my user space (User:Y0 ich halt), you'll notice that I have several of them: One overall nav (User:Y0 ich halt/PageNav), one navigation for subpages (User:Y0 ich halt/OtherNav), and another navigation for characters. (User:Y0 ich halt/Characters). User:Y0 ich halt/Templates nav is another one for templates only, but this one doesn't include the other navigations.

Navigations are bits of code that you put on every page they link to. So I have my main navigation on the main page, the talk page and the subpages navigation. Mine are already a bit more complicated since they are templates, which is explained at the end of this section.

We'll take User:Idi0t/Navbar. Here's the nav bar:



Wow, that's one chunk of code, isn't it? Looking through it, you might have noticed that its code is actually repetative. You can clearly see that it's a table, and the huge blocks of code at the bottom are just some formatting, each cell gets the same with different colors (the profession color templates are used as you can see). Let's get rid of all the repetitions:



Everything else is exactly the same for all the other professions.

First, the formatting for the whole table:

That's rather clear. This table will be full browser width, have a transparent background, no border and slightly smaller text than normal. the cells will have no padding and spacing inbetween.

Second, the head cells:

The exclamation mark is the head cell mark as you learned above. now, in this head cell there's a division. The formatting here moves the division 15px down from its normal position. Inside the div, there's a profession icon.

And third, the body cells: That's a bit more to go through. First: |, the cell mark. then. This will locate cell content to the vertical middle of the cell. align="center" aligns both cell and its content to the horizontal center. The following are profession background color, paddings and border (actually, this could be done much shorter than in the example, but it works like that). is kinda totally unimportant here. And then, after another pipe, follows the cell content, a link.

Once the navbar is finished, you can either put the whole code on each page, or save very much space by putting  on each page. This is called an inclusion. It will simply show the whole page which you are including, but its code is much shorter.

You can include any page on the wiki. There are special pages made only for including: templates. They are included by simply using, where X is the template's name, e.g. "Titles nav" (Template:Titles nav). To include other pages, you have to add the namespace. So, to include templates of mine (User:Y0 ich halt/Templates), you'll have to use.

An important feature of inclusions is that you can substitute them. This means, after saving, the inclusion is actually replaced by the code you are including. You can substitute inclusions by adding "subst:" like this:. This will put the code from Template:User Lyssa on your page after saving. This works with everything inside curly brackets. Templates, included pages, even the "magic word" variables, like. The difference is, inclusions change when the included page is changed (which puts strain on the server). The code result from a substitute isn't linked to its source anymore, so it doesn't change if the source gets changed (that's also why substitutes don't show up in the "what links here" list of the source). Templates like Template:Unsigned are usually substituded. That's because if not it could crash the whole server by changing just one small letter, since every single inclusion would have to be changed, and the unsigned template is one of the most frequently used templates.

Templates
(This section has been added after writing everything else, and I'm too lazy to rewrite everything so it fits with the content. Please ignore if I repeat myself here, or just tell me on the talk page :P)

As we have a growing collection of templates for user pages, I think I should mention them in a guide to user page layouting. I already explained above, templates are just pages that are specifically made for easy use on other pages. User boxes, for example, are usually templates. The code is put on one page and everyone just puts an inclusion of that on their user page. to get the box.

To include a template, use the code. Example: You want to get the user box Template:User Male. As this is a page in the "template" namespace, you only need to put the name itself into curved brackets, like this:. I'd include it here to show you what it looks like, but this user box template sorts the page it is on into the Category:Users who are male, and this guide is certainly not male ;)

However, not only templates can be included, as already said. Actually, all pages can. You'll just have to use the full page name with namespace etc. if it's not in the template namespace. This is the case for most templates in Category:User templates. As an example, for my templates you'll have to use  (this would be my explorer title bar). There are shorter template names of course, like User:Karuro/T/Lore (random example I found in the user template category). You can even include the main page with  (the colon means the page is in main space, not template), if you need to for some unkown reason.