Code Snippets Wiki
Advertisement

To transclude something is to bring something on to a page so you don't have to.

How to transclude a..[]

Mainspace[]

Mainspace are usually not transcluded at all, except when salting pages. Here's how:

  1. {{ The bracket
  2. {{: The colon so it won't get confused with a template
  3. {{:Barnstars Enter a name. For this instance, we'll use Red link.
  4. {{:Barnstars}} Now close the brackets.

Now you have a transcluded mainspace page:


Barnstars are decorative awards that are given to users to thank them for editing and article or reverting vandalism, they are oftenly 5 pointed but also sometimes in a wagon wheel style which is to adorn a barn.

Barnstars characteristics, such as border, background colour, text colour, text and image can be altered depending on the purpose of gifting a user one.

Here is an example of a barnstar;

Barnstar barnstar The Guest Book Barnstar
This barnstar is awarded to [username goes here] for signing A Users Guestbook.

This is an award given for signing a guest book.

How to create a Barnstar[]

First you start out with

{|

This is how you start all templates. Then you create a border and pick a border color. The colors may be in either Hex triplet format, or typed in a special way using the word. (this will be explained later.) This code would create a black border:

style="border:1px solid {{border|#000000}};

You can pick the size of the border by changing the number of pixels (px) and the color by simply inserting the hex triplet code for the color you want. Next you need a background color. This is done in much the same way with a minor alteration:

background-color: {{color|#FF0000}};"

In order to make a complete box there is one more thing we must do, which is put something in the box, to do this you will use this code;

|rowspan="2" valign="middle" | [[Image:Barnstar_barnstar.png|100px]]

(Please note you can use any image you desire, you must simply just upload it and insert the desired picture where I put mine.)

Now you have your basic box, it will look like something this:

Barnstar barnstar

Next we need to insert the information, such as the title of the barnstar and the information we want to be displayed, heres how. this code will create a title,

|style="font-size: x-large; padding: 0; vertical-align: middle; height: 1.1em;"<font color=#BFFF00>Example Barnstar</font>

now here is an example of what to do for the non hex decimal colors. In creating a title with color, such as the example barnstar. you add the same code but with a new ending, here is the example.

|style="font-size: x-large; padding: 0; vertical-align: middle; height: 1.1em;" | <font color="lime green">Example Barnstar</font>

so here is what we have so far.

Barnstar barnstar Example Barnstar

Now we are almost done, we just have to insert the rest of the information, heres how.

|-
|style="vertical-align: middle; border-top: 1px solid gray;" |<font color="gold">This barnstar is an example and was created by Sirkad specifically for this article.</font>
|}

(Note:At the end of a template you must always make a new line and put |} otherwise it will not create it correctly. but it MUST BE MADE ON A NEW LINE.)

If we finally add all this together we get the final product, a finished barnstar.

{| style="border: 1px solid {{{border|#000000}}}; background-color: {{{color|#FF0000}}};" |rowspan="2" valign="middle" | [[Image:Barnstar_barnstar.png|100px]]
|style="font-size: x-large; padding: 0; vertical-align: middle; height: 1.1em;" | <font color="green">Example Barnstar</font>
|-
|style="vertical-align: middle; border-top: 1px solid gray;" |<font color="gold">This barnstar is an example and was created by Sirkad specifically for this article.</font>
|}
Barnstar barnstar Example Barnstar
This barnstar is an example and was created by Sirkad specifically for this article.

(If you don't know Hexadecimals or don't want to study up on them, you can simply use the regular name of the color, which is a lot easier for the beginners.)

See also[]

Hex Triplet Colors


Items with namespace prefixes[]

To transclude something with a prefix, such as Code Snippets Wiki, do this:

  1. {{ Do the same as before, but except for putting a : on there, put a bracket, and
  2. {{Code Snippets Wiki: the prefix. In this case, we'll use Code Snippets Wiki.
  3. {{Code Snippets Wiki:Celebrity Impersonation}} Now, enter the name you want to use. For this case, we'll use CSW:CELEB. Now close the brackets.

Now you have a transcluded projectspace page:


Code Snippets Wiki:Celebrity Impersonation


Templates[]

To transclude a template, simply type two brackets ({{), then the template name (we'll use the unblock template) ({{unblock}} ), then close the brackets.

Now you have a transcluded template:



Um, excuse me? Janitor? Custodian? Crat? I'm sorry for what I did because {{{1}}}.


Note to reviewing janitor, custodian, or crat: please copy this down when you have finished reviewing:

{{subst:Unblock reviewed|1={{{1}}}|2=accept or decline?|reason=|3=your message here.}}

WARNING TO PERSON WHO WANTS TO BE UNBLOCKED: YOU MAY ONLY USE THIS TEMPLATE THREE TIMES. ABUSE OF THE TEMPLATE WILL RESULT IN BLOCK OF YOUR E-MAIL AND PROTECTION OF YOUR TALK PAGE. KEEP THIS IN MIND!



See Also[]

Advertisement