Jump to content

User:MyNameIsJason: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
{{Help}}
{{Help}}
Hi! I'm Jason. :)
Hi! I'm Jason. :)
==Consider this==
{{Karl Koch quote|nudists, a new question has arisen: nudists. nudists?|[[Historic event: 07/18/1992|asking an important question.]]}}
==Please also consider this==
[[Image:Leia Bell Weezer Poster 2005.jpg|center|thumb|400px|[https://www.stereogum.com/2224074/weezer-perform-for-striking-writers-outside-paramount/news/ May 2023 doing the right thing]]]
{{Test}}
yes
{{Aboutme}}
{{Aboutme}}
{{Aboutme:Custom|000000|facdf0|Draggy girl.png|facdf0|My pronouns are they/them.|000000}}
{{Aboutme:Custom|000000|facdf0|Draggy girl.png|facdf0|My pronouns are they/them.|000000}}
Line 53: Line 39:
{{Aboutme:Day1}}
{{Aboutme:Day1}}
{{Aboutme:End}}
{{Aboutme:End}}
==#if template==
<pre>{{#if:{{{release d|}}}|on|in|}}</pre>
I used this example in the [[Template:Album page machine|album page machine template]]. It fills in the first sentence of the lede of an album page with one of two options: the word "on," (i.e. "on March 12") or the word "in" (i.e. "in 2023"), depending on whether or not the user inputs a release date (i.e. "March 12") into the infobox. If they only put 2023 as a year and leave the release date blank, the template will "by default" make the lead "in {{{year}}}".<br><br><br>
<big>but you don't have to remember that to understand this</big><br><br><br>
Just think this:
<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 {{Wiki2|Help:Transclusion|transclude}} whatever you have in the "yes" slot to the page.
<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.