Template talk:Day-1
![]() | Template:Day-1 is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. This template does not have a testcases subpage. You can create the testcases subpage here. |
Fourth space parameter
[edit]Why is this parameter needed? The only case I've seen for it is to return an underscore instead of a space, within URLs. However, MediaWiki performs this transformation natively, and it is not needed for normal Wiki links. This unnecessarily complicates this huge and ugly template... verdy_p 08:56, 3 May 2006 (UTC)
- MediaWiki performs '_' to ' ' transformation natively, but not ' ' to '_' since space is used to indicate the end of the URL in wiki-links. Thus, when a URL needs to include an '_' character it must be specifically stated. Compare the results with ' ' vs '_' below;
- In the first example the space is treated as the end of the URL and everything to the right of that as the text to display in the link. In the second example the space is replaced with an underscore and the full correct URL is used. --CBDunkerson 12:36, 3 May 2006 (UTC)
Ugly and unnecessarily complicate huge template for most cases
[edit]This template should be really simplified by separating the 3 usages documented above.
This really increases the workload on the wikiserver, notably for the first case which uses the current datetime, and that should be removed and put into a separate and much simpler template.
The huge part of this template is needed only when the pagetype parameter is used:
- Make things really simpler when pagetype is not needed.
- When pagetype is needed, this template will not use the current datetime, because this use will be inserted only in a page which already has an explicit date that does not depend on current date.
verdy_p 08:56, 3 May 2006 (UTC)
- As you note, the primary complexity of this template is due to the 'pagetype' usage... barring the introduction of general string manipulation functions or sectional 'PAGENAME' magic words there is no way to simplify that. The {{yesterday}} template already 'splits out' calculation based on the current date as you suggest, but removing that as the 'default' for this template would not reduce the complexity of the code at all. I also can't see how including it "really increases the workload on the wikiserver"... even assuming that the page cache of every page which uses this template is invalidated when the currentdate changes - it's once per day. On a few hundred pages. I haven't really noticed a huge performance hit at midnight each day... so is there any evidence that this is really an issue? --CBDunkerson 12:49, 3 May 2006 (UTC)
- I agree that this template should be simplified. --Meno25 15:14, 26 November 2006 (UTC)
Documentation
[edit]{{editprotect}} Please added <noinclude>{{Documentation}}</noinclude>. Thanks. -- Suntag ☼ 12:41, 4 October 2008 (UTC)
- Done. --CBD 17:28, 4 October 2008 (UTC)