Difference between revisions of "Template:Discussion"

(notes are what this does)
(make yellow more pale)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#if:{{{1|}}}
+
{{#switch: {{{1|}}}
|
+
| =
<div class="NavHead" style="padding-left:1em; background:#F5E10F;">Discussion</div>
+
| "discussion here" =
 +
| #default = <div class="NavHead" style="padding-left:1em; background:#FFFF99;">Discussion</div>
 
<div class="NavContent">{{{1|}}}</div>
 
<div class="NavContent">{{{1|}}}</div>
|
 
 
}}<noinclude>
 
}}<noinclude>
This template works for <nowiki>{{Discussion|}}</nowiki> where there is not discussion, and thus returns no discussion header (blank), and for <nowiki>{{Discussion|Here is the discussion}}</nowiki> which returns both the show/hide discussion header and the discussion itself.
+
== If there is no discussion ==
 +
<nowiki>{{Discussion|}}</nowiki> and <nowiki>{{Discussion|"discussion here"}}</nowiki>
 +
 
 +
return blank:
 +
 
 +
{{Discussion|}} {{Discussion|"discussion here"}}
 +
 
 +
== If there is discussion ==
 +
 
 +
<nowiki>{{Discussion|Here is the discussion}}</nowiki> returns:
 +
 
 +
{{Discussion|Here is the discussion}}
  
The next version should work just the same, but also return blank for <nowiki>{{Discussion|"replace this text with any discussion"}}</nowiki> perhaps by using the #switch function instead of #if.
 
 
</noinclude>
 
</noinclude>

Latest revision as of 09:55, 19 November 2007

If there is no discussion

{{Discussion|}} and {{Discussion|"discussion here"}}

return blank:


If there is discussion

{{Discussion|Here is the discussion}} returns: