Template talk:Npd
I've tweaked this template so that the source= part can be left out of the parameter. Feel free to revert if it breaks the template. Stifle (talk) 10:13, 4 September 2008 (UTC)
#if
[edit]{{editprotected}}
This template does not work correctly. The "{{#if:
" should be replaced with "{{<includeonly>subst:</includeonly>#if:
".--OsamaK 16:53, 12 October 2008 (UTC)
- Should work now. --- RockMFR 19:14, 13 October 2008 (UTC)
Code Update
[edit]{{editprotected}}
Could a templatey administrator change this
<includeonly>{{subst:</includeonly><includeonly>void|{{error:not substituted|npd}}}}{</includeonly><noinclude>{</noinclude>{<noinclude>[[Template:</noinclude>di-no permission<noinclude>|di-no permission]]</noinclude>|
{{
<includeonly>subst:</includeonly>
#if:{{{1|{{{source|}}}}}}|source={{{1|{{{source}}}}}}{{
<includeonly>subst:</includeonly>
!}}}}date=
{{<includeonly>subst:</includeonly>CURRENTDAY}} {{<includeonly>subst:</includeonly>CURRENTMONTHNAME}} {{<includeonly>subst:</includeonly>CURRENTYEAR}}
}}<noinclude>{{documentation}}
{{pp-template|small=yes}}
</noinclude>
to this
<includeonly>{{{{{|safesubst:}}}substchecktop|Npd|subst={{{subst|}}}}}</includeonly>{{<noinclude>tlp|</noinclude>di-no permission|
{{
{{{|safesubst:}}}
#if:{{{1|{{{source|}}}}}}|source={{{1|{{{source}}}}}}{{
{{{|safesubst:}}}
!}}}}
<noinclude>2=</noinclude>
date=
{{{{{|safesubst:}}}Date}}
}}
<includeonly>{{{{{|safesubst:}}}substcheckbottom|subst={{{subst|}}}}}</includeonly>
<noinclude>{{Documentation}}</noinclude>
at Template:Npd? Thanks. Set Sail For The Seven Seas 12° 16' 45" NET 00:49, 13 September 2010 (UTC)
- Not done at present. Has this been tested in a sandbox? Also, what does the change do? If it merely simplifies the code, my inclination is "If it ain't broke, don't fix it." — Tivedshambo (t/c) 21:46, 21 September 2010 (UTC)
A copy of this code can now be found in the sandbox and its effects can be seen at testcases. The template updates include the following changes:
- Updating the substitution check code to a more efficient version.
- Updating the date parameters to use existing date templates rather than variables, simplifying the code.
- Optimising the demo display on the Template:Npd page to use Template:Tlp, simplifying the code.
- Removing the redundant page protection template, which is already included as part of the documentation.
- Moving categories to the documentation subpage.
Thanks. Set Sail For The Seven Seas 344° 16' 45" NET 22:57, 21 September 2010 (UTC)
- Done — Martin (MSGJ · talk) 11:04, 22 September 2010 (UTC)