Template talk:DATE
From Wikipedia, the free encyclopedia
- Sourcecode of fact template
<sup class="noprint">[[[Wikipedia:Citing sources|''<span title="This claim needs references to reliable sources" style="white-space: nowrap;">citation needed</span>'']]]</sup> <includeonly>{{#if: {{NAMESPACE}} || {{#if:{{{date|}}}|[[Category:Articles with unsourced statements since {{{date}}}]]|[[Category:Articles with unsourced statements]]}}[[Category:All articles with unsourced statements]]}}</includeonly><noinclude> <!-- Do not remove the space between </sup> and <includeonly>; see talk for the reason --> {{fact/doc}} </noinclude>
[edit] Tools
|
- lts|DATE3
- [citation needed] —
- Testing: {{fact|{{subst:DATE}}}}
- Result1: [citation needed] }}
{
[edit] Try 2
- Testing: {{fact|{{subst:DATE}}}}
- Result2: [citation needed]}}
[edit] Try 3
A) defined DATE3=={{ B) Modified DATE so defined {{DATE3}}subst:DATE2|SUBST=subst:
When DATE3 is merely two left curly braces. C) Same test line:
- Testing: {{fact|{{subst:DATE}}}}
- Result3: {{fact|{{DATE3}}Subst:DATE2|SUBST=subst:}}}}
[edit] Try 3b -- Save again
- testing subsequent results if Result3 saved again later
- [citation needed]}}
- Absolutely no change... hence DATE3 must need be subst'd as well.
[edit] Try 4
- Modify DATE yet again. DEF:{'{{{SUBST}}}DATE3'}Subst:DATE2|SUBST=subst:}}
- SAME TEST LINE:
- Testing: {{fact|{{subst:DATE}}}}
- Result4: [citation needed]}} (preview-- still seeing extra right braces)
Conclude I misunderstood what CBD said about self-defining parameters. // FrankB 08:52, 27 February 2007 (UTC)
[edit] Try 5
- DATE defined as
- 'SUBST=subst:|{' {{{SUBST}}}DATE3'}Subst:DATE2}}}}'
- Same test line
- [citation needed]}}}} ==(Get four unbalanced right braces now, not just two.
- Result 5: {{fact|SUBST=subst:|{{ {{{SUBST}}}DATE3}}Subst:DATE2}}}}}}
[edit] Try 6
- redefine DATE=<includeonly>{{subst:DATE3}}subst:DATE2|SUBST=subst:}}</includeonly>
- Same test line
- Result 6: [citation needed] -- looks clean on preview!
- Result a: {{fact|date={{subst: CURRENTMONTHNAME}} 2007}}...
Is this a whitespace effect, or does it need one more save? // FrankB 09:24, 27 February 2007 (UTC) - Appears to dislike whitespace...
- Test 6b: {{fact|date={{subst: CURRENTMONTHNAME}} 2007}}
Changed TO: {{fact|date={{subst:CURRENTMONTHNAME}} 2007}} - [citation needed] So subst dislikes the whitespace // FrankB 09:28, 27 February 2007 (UTC)
- Test 6b: {{fact|date={{subst: CURRENTMONTHNAME}} 2007}}
[edit] Test Lucky 7
- Eliminated the single extra space in DATE2
- Same test line: Testing: {{fact|{{subst:DATE}}}}
- Result 7: Testing: [citation needed] -- Looks good in preview!
- BINGO!
{{fact|date=February 2007}}
I think it's cooked, Jim! // FrankB 10:04, 27 February 2007 (UTC)
[edit] How about an error message
- {'lts|DATE3'}
- {{#ifeq:{{NAMESPACE}}|{{<includeonly>subst:</includeonly>NAMESPACE}}| |{{error:not substituted|cfd}}... looks easy enough.
[edit] Test error logic
- date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}
- date=February 2007
- We'll call this a wrap! // FrankB 10:04, 27 February 2007 (UTC)
[edit] Checking current state
See CBD may have fixed up already... recent application added a bunch of additional crap.
[{{subst:DATE}}] gives [date=March 2007] That result is:
[{{#ifeq:{{NAMESPACE}}|Template talk| |{{error:not substituted|DATE}}<div style="display:none;">}}date=March 2007</div>]
when viewed directly in edit mode.
// FrankB 13:41, 23 March 2007 (UTC)
- CBD -- think this would be better unequipped with the test logic, and take the chance people will just know to subst it? // FrankB 13:50, 23 March 2007 (UTC)
[edit] revised code, sans test
- {{unclear|{{Subst:DATE}}|message}} [unclear]
Expanded result substd: {{unclear|date=date=March 2007|message}} - {{unclear|{{DATE}}|message}} [unclear]
Expanded result unsubstd: {{unclear|date=date=March 2007|message}}
yet case 1 functions somewhat... which is to say doesn't harm 'unclear'//FrankB 14:12, 23 March 2007 (UTC)
[edit] Try again 2:
- {{fact|This is contrary to news accounts|{{DATE}}}}
Unsubstd: [citation needed]
Substed: [citation needed]
Subst'd expanded result: {{fact|This is contrary to news accounts|{{DATE2{{!}}SUBST=subst:}}}}
[edit] Try again 3:
- {{fact|This is contrary to news accounts|{{DATE}}}}
Unsubstd: [citation needed]
Substed: [citation needed]
Subst'd expanded result: {{fact|This is contrary to news accounts|date=March 2007}}
... which is just what we're looking for. The message and subst warning is nice, but ultimately unecessary. // FrankB 14:57, 23 March 2007 (UTC)