User blog:Rianza33/Lessons in Coding

From Jens: It's not that hard than you think. An template is simply an data-layout where you can add data inside. The perfect example is an easy infobox Template:Infobox. The parameters are just information that you display. For example an easy table: Source: Now in case of an template we can add some text as an parameter. This mean we create an template with the following source: So let's say our template name is "MyTableTest". We create the pageTemplate:MyTableTest and pass the above source to this template. Ones you save the template he's ready for action:

On an random page, forum or comment you add the following source (in source mode!!): {{MyTableTest |Header = |Headertext = |Text = |Text2 = |}  [Expand]  Source Mode — The safe way to editSource mode is designed to handle complex html codes on an article, allowing to reduce the amount of unwanted code that is sometimes automatically added. Source mode is the best way to edit if you are using templates, or html tags such as , , and . Click "Expand" to learn how to you can switch to this mode and make your code look cleaner.

Well now you have your first template. Here's an example: {{MyTableTest |Header = MyHeader |Headertext = MyHeadText |Text = Easy |Text2 = Zzz... |} 



For the database their is something else I used and that's switch codes. Basicly the system is buildup with these code to create an kind off variables. Let's name the template "datatest":

Template:datatest Used Input Now imaging this would be post of the Terra Dragon page. Than you will see the word "Stone" popup on the location you placed the input. So what the switch code does is checking the name of the parameter. In this case he checks for the pagename. So if it was place on the Nature Dragon page we would  not  see the word "Stone". We would see the word "Leaves". 2 days ago