MyNameIsJason
Joined 27 September 2008
no edit summary
No edit summary |
|||
| Line 46: | Line 46: | ||
Just think this: | Just think this: | ||
<pre>{{#if:{{{template parameter|}}}|yes|no|}}</pre> | <pre>{{#if:{{{template parameter|}}}|yes|no|}}</pre> | ||
I should '''replace the "yes" slot with whatever I want to appear if the template parameter is filled in by the user'''. In this case it actually doesn't matter what they input - they can keysmash as long as it doesn't trip up the syntax. The #if template changes the behavior of a template to not merely call and replace information - in a way it is an simpler task for the wiki to process: "is the parameter empty or not?" If it isn't empty, the template will | I should '''replace the "yes" slot with whatever I want to appear if the template parameter is filled in by the user'''. In this case it actually doesn't matter what they input - they can keysmash as long as it doesn't trip up the syntax. The #if template changes the behavior of a template to not merely call and replace information - in a way it is an simpler task for the wiki to process: "is the parameter empty or not?" If it isn't empty, the template will {{Wiki2|Help:Transclusion|transclude}} whatever you have in the "yes" slot to the page. | ||
<pre>{{#if:{{{template parameter|}}}|yes|no|}}</pre> | <pre>{{#if:{{{template parameter|}}}|yes|no|}}</pre> | ||
I should '''replace the "no" slot with whatever I want to appear "by default."''' In the case that the editor doesn't fill this parameter in, or doesn't even list the parameter at all, the template will display whatever you type in the "no" slot. If you're reading this, go back to the release date example above and read it again - I think it will make more sense. | I should '''replace the "no" slot with whatever I want to appear "by default."''' In the case that the editor doesn't fill this parameter in, or doesn't even list the parameter at all, the template will display whatever you type in the "no" slot. If you're reading this, go back to the release date example above and read it again - I think it will make more sense. | ||