Template talk:Dr

(Redirected from Template talk:Dr/testcases)
Latest comment: 2 years ago by Largoplazo in topic Confusing name

Value of this template

edit

What's the value of this template? It can't be economy of typing or thinking: [[460s BC]] is rather easier to type than {{dr|c|d|-5|3|s}} and requires no thought. —Largo Plazo (talk) 11:59, 4 March 2014 (UTC)Reply

Millennium: 2nd millennium
Centuries:
Decades:
Years:
@Largoplazo: It's heavily used by templates such as {{Year nav}} which auto-generate a table of dates based on a single input date. For example {{Year nav|1946}} creates the table on the right:
It makes all that from the single input number "1946" by making multiple calls to {{dr}}.
This template isn't intended to be used by ordinary editors; it's for template editors to use in templates. – wbm1058 (talk) 02:08, 15 November 2016 (UTC)Reply

How does it do that?

edit

How does this template create links? AChildOfGod (talk) 16:30, 1 November 2016 (UTC)Reply

@AChildOfGod: It uses Template:Dr-make to make links, of course! {{Dr-make}} uses Template:Drep. Even I, a template editor would need some time to study it to understand the details of how it works. If you look at the template code, it's barely human-readable ;) Hey, it's a black box, and if it works, don't worry about it. wbm1058 (talk) 02:39, 15 November 2016 (UTC)Reply
I missed {{Dr-make}} when I was looking at the code for those templates. AChildOfGod (talk) 13:59, 15 November 2016 (UTC)Reply

Confusing name

edit

What does "dr" stand for? "Date render" or something? Templates should be intuitively named, so I'd suggest moving this and related pages to something more logical, even if the shortcuts are kept. Or at least define the name in the documentation. {{u|Sdkb}}talk 01:35, 15 October 2021 (UTC)Reply

Would like to know the answer too for the purposes of localization. --Renessaince (talk) 17:28, 6 December 2021 (UTC)Reply
Seems like Kotniski retired in 2012, so we may never know. If anyone wants to rename the group, feel free. {{u|Sdkb}}talk 18:28, 6 December 2021 (UTC)Reply
From Template:Drep/doc and Template:Dr-make/doc, I'm guessing "date representation". Largoplazo (talk) 19:29, 6 December 2021 (UTC)Reply
Wait, what's the difference between this and {{drep}}? Should they be merged?
Good find on the name. If others support, I can move this to Template:Date representation and note {{Dr}} in the doc as a shortcut. {{u|Sdkb}}talk 19:49, 6 December 2021 (UTC)Reply
Looking at the call sequence and the respective call syntax of all three, it appears that {{dr}} is two levels of API abstraction above {{drep}}, with {{dr-make}} in between them. Nothing more than that.
Is there a way to list only pages that transclude a template directly? When I click "What links here" for {{drep}}, I still get every article that transcludes {{year nav}}, which transcludes {{dr}}, which transcludes {{dr-make}}, which transcludes {{drep}}. Largoplazo (talk) 20:48, 6 December 2021 (UTC)Reply
Perhaps update the first sentence of the documentation to read "Provides a consistent means of generating a representation for a year, decade, century or millennium for use in an infobox or navbox." Largoplazo (talk) 19:34, 6 December 2021 (UTC)Reply