|
|
(One intermediate revision by one other user not shown) |
Line 193: |
Line 193: |
| </tr> | | </tr> |
| </table> | | </table> |
| *Notice all we have done to create the parameters is enclose the item with opening and closing <font color="red">{{{ }}}</font color>. That is all. | | *Notice all we have done to create the parameters is enclose the item with opening and closing <font color="red">{{{}}}</font color>. That is all. |
| *In the wikitext, things are really getting hard to differentiate. There are a lot of curly brackets on the code. Again showing that using HTML is less messy than Wikitext. | | *In the wikitext, things are really getting hard to differentiate. There are a lot of curly brackets on the code. Again showing that using HTML is less messy than Wikitext. |
|
| |
|
Line 242: |
Line 242: |
| |hours open=Mon 1pm - 6pm | | |hours open=Mon 1pm - 6pm |
| }} | | }} |
| *Some infoboxes can get very long. If you list all the attributes of an organization can possibly there can be quit a few items listed. | | *Some infoboxes can get very long. If you list all the attributes of an organization can possibly there can be quite a few items listed. |
| *If the infobox is long but you only have a small organization, you could end up with an infobox taking up a lot of room on the page but with little information in it. Maybe the organization does not even have a phone number like in our example here. | | *If the infobox is long but you only have a small organization, you could end up with an infobox taking up a lot of room on the page but with little information in it. Maybe the organization does not even have a phone number like in our example here. |
| *Well it is possible to code the infobox so that the item "phone" does not appear if there is none. It is done simply by adding this coding to the parameter. | | *Well, it is possible to code the infobox so that the item "phone" does not appear if there is none. It is done simply by adding this coding to the parameter. |
| *This is an example of adding the additional code to the President line:<br><br> | | *This is an example of adding the additional code to the President line:<br><br> |
| :*Wikitext: | | :*Wikitext: |
Line 253: |
Line 253: |
| <br><br> | | <br><br> |
| This coding looks a bit intimidating but it is really not hard<ref>The coding is called Parser functions. You can read more about them at [[Help:Magic words#Parser functions]] and [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Parser Functions]</ref>. | | This coding looks a bit intimidating but it is really not hard<ref>The coding is called Parser functions. You can read more about them at [[Help:Magic words#Parser functions]] and [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Parser Functions]</ref>. |
| *Notice that there are <font color="red">{{ }}</font color> at each end of the expression. | | *Notice that there are <font color="red">{{}}</font color> at each end of the expression. |
| *After the first set of <font color="red">{{</font color> notice <font color="red">#if:</font color> which consists of a pound sign <font color="red">#</font color>, the word <font color="red">if</font color> and a colon <font color="red">:</font color>. | | *After the first set of <font color="red">{{</font color> notice <font color="red">#if:</font color> which consists of a pound sign <font color="red">#</font color>, the word <font color="red">if</font color> and a colon <font color="red">:</font color>. |
| *After the colon you see the parameter repeated with the addition of a pipe after the word inside the <font color="red">{{{}}}</font color> and a pipe on the outside like so:<font color="red"><nowiki>{{{parameter|}}}|</nowiki></font color>. We will not take the time to explain what all this code means but if you are interested see the footnote<ref>The coding looks complicated but it is really not. First this is an “if” statement. In essence, it says “if” you have A do B or if you do not, do C. Or another way to put it, if you have peanut butter, make a sandwich otherwise starve. | | *After the colon you see the parameter repeated with the addition of a pipe after the word inside the <font color="red">{{{}}}</font color> and a pipe on the outside like so:<font color="red"><nowiki>{{{parameter|}}}|</nowiki></font color>. We will not take the time to explain what all this code means but if you are interested see the footnote<ref>The coding looks complicated but it is really not. First this is an “if” statement. In essence, it says “if” you have A do B or if you do not, do C. Or another way to put it, if you have peanut butter, make a sandwich otherwise starve. |
Line 260: |
Line 260: |
| *To explain the code: | | *To explain the code: |
| *First, this bit of code is enclosed with <nowiki>{{}}</nowiki>. | | *First, this bit of code is enclosed with <nowiki>{{}}</nowiki>. |
| *Following the first <nowiki>{{ is #if:</nowiki>. This code tells the browser that a “if” statement is coming. For our peanut butter example, the question is, do we have any peanut butter? This test statement or called a “test string,” is separated from our two options with a pipe. Our first option is to “make a sandwich.” The second option is to “starve.” The two options themselves are separated by a pipe. | | *Following the first <nowiki>{{is #if:</nowiki>. This code tells the browser that a “if” statement is coming. For our peanut butter example, the question is, do we have any peanut butter? This test statement or called a “test string,” is separated from our two options with a pipe. Our first option is to “make a sandwich.” The second option is to “starve.” The two options themselves are separated by a pipe. |
| *This coding is testing to see if there is a positive value in the test string or if there is any peanut butter. If there is a positive value, the browser picks the first option, “make sandwich” if there is no value or no peanut butter, it picks the second option “starve.” | | *This coding is testing to see if there is a positive value in the test string or if there is any peanut butter. If there is a positive value, the browser picks the first option, “make sandwich” if there is no value or no peanut butter, it picks the second option “starve.” |
| *So if there really is NO peanut butter, you can leave the space is blank like so: | | *So if there really is NO peanut butter, you can leave the space is blank like so: |