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

Contents

  1. Template:DATE (edit talk links history)
  2. Template:DATE2 (edit talk links history)
  3. lts|DATE3
  4. Template:Fact (edit talk links history)[citation needed]

{

[edit] Try 2


[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

  1. Modify DATE yet again. DEF:{'{{{SUBST}}}DATE3'}Subst:DATE2|SUBST=subst:}}
  2. 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}}}}'
  1. Same test line
  2. [citation needed]}}}} ==(Get four unbalanced right braces now, not just two.
  3. Result 5: {{fact|SUBST=subst:|{{ {{{SUBST}}}DATE3}}Subst:DATE2}}}}}}
    1. what if DATE cited void as opening portion? // FrankB 09:06, 27 February 2007 (UTC)

[edit] Try 6

  1. redefine DATE=<includeonly>{{subst:DATE3}}subst:DATE2|SUBST=subst:}}</includeonly>
  2. Same test line
  3. Result 6: [citation needed] -- looks clean on preview!
  4. 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)
  5. Appears to dislike whitespace...
    1. Test 6b: {{fact|date={{subst: CURRENTMONTHNAME}} 2007}}
         Changed TO: {{fact|date={{subst:CURRENTMONTHNAME}} 2007}}
    2. [citation needed] So subst dislikes the whitespace // FrankB 09:28, 27 February 2007 (UTC)

[edit] Test Lucky 7

  1. Eliminated the single extra space in DATE2
  2. Same test line: Testing: {{fact|{{subst:DATE}}}}
  3. Result 7: Testing: [citation needed] -- Looks good in preview!
  4. BINGO! {{fact|date=February 2007}}
       I think it's cooked, Jim! // FrankB 10:04, 27 February 2007 (UTC)

[edit] How about an error message

  1. Template:Cfd (edit talk links history)
  2. Template:DATE (edit talk links history)
  3. Template:DATE2 (edit talk links history)
  4. {'lts|DATE3'}
  5. {{#ifeq:{{NAMESPACE}}|{{<includeonly>subst:</includeonly>NAMESPACE}}| |{{error:not substituted|cfd}}... looks easy enough.

[edit] Test error logic

  1. date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}
  2. date=February 2007
  3. We'll call this a wrap! // FrankB 10:04, 27 February 2007 (UTC)
  • Db-authored DATE3, And excised it above. // FrankB 10:12, 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

  1. {{unclear|{{Subst:DATE}}|message}} [unclear]
       Expanded result substd: {{unclear|date=date=March 2007|message}}
  2. {{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:

  1. {{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:

  1. {{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)