Template talk:Births and deaths TOC

Latest comment: 5 months ago by DavyK17 in topic problem reported via VRT

work to be done

edit

OK, I can see the value of this template, but there are problems:

  1. Only for years between 1950, or so, and 2000 (or later years with a data-dump in the "Births" section) is it likely that "deaths" would be section 3. It might be simpler to have section and title be mandatory or positional parameters.
  2. "sectionn=" or "usection=" should override "section=", rather than the other way around.
  3. The display should have some breaking spaces, and not use tables, so that it will do something on a small screen, rather than run off the side.
  4. There still seems to be a full line of whitespace between the table and the start of text. It probably needs to be reduced, somehow.
  5. It might be simpler to use subtemplates. For example, the main template could consist of
code cannot work or display; it can only appear in the edit window
 {{ {{PAGENAME}}/main|
|section= {{#if:{{{section|}}}|{{{section}}}|{{#switch:{{{1|}}}|births=2|deaths=3|1}}}}
|title={{#if:{{{title|}}}|{{{title}}}|{{#switch:{{{1|}}}|births=Births|deaths=Deaths|Content}}}}
|section1={{{section1|}}}
|section2={{{section2|}}}
|section3={{{section3|}}}
|section4={{{section4|}}}
|section5={{{section5|}}}
|section6={{{section6|}}}
|section7={{{section7|}}}
|section8={{{section8|}}}
|section9={{{section9|}}}
|section10={{{section10|}}}
|section11={{{section11|}}}
|section12={{{section12|}}}
|sectionu={{{sectionu|}}}
|unknown={{#ifeq:{{Yesno|{{{unknown|no}}}}}|Date unknown}}
|{{#if:{{{{2|}}}|{{{{2}}}}|January}}
|{{#if:{{{{2|}}}|{{#if:{{{{3|}}}|{{{3}}}|}}|February}}
|{{#if:{{{{2|}}}|{{#if:{{{{4|}}}|{{{4}}}|}}|March}}
|{{#if:{{{{2|}}}|{{#if:{{{{5|}}}|{{{5}}}|}}|April}}
|{{#if:{{{{2|}}}|{{#if:{{{{6|}}}|{{{6}}}|}}|May}}
|{{#if:{{{{2|}}}|{{#if:{{{{7|}}}|{{{7}}}|}}|June}}
|{{#if:{{{{2|}}}|{{#if:{{{{8|}}}|{{{8}}}|}}|July}}
|{{#if:{{{{2|}}}|{{#if:{{{{9|}}}|{{{9}}}|}}|August}}
|{{#if:{{{{2|}}}|{{#if:{{{{10|}}}|{{{10}}}|}}|September}}
|{{#if:{{{{2|}}}|{{#if:{{{{11|}}}|{{{11}}}|}}|October}}
|{{#if:{{{{2|}}}|{{#if:{{{{12|}}}|{{{12}}}|}}|November}}
|{{#if:{{{{2|}}}|{{#if:{{{{13|}}}|{{{13}}}|}}|December}} }}

Arthur Rubin (talk) 10:04, 25 July 2014 (UTC)Reply

@Arthur Rubin: I get the point you made about not having the table run off the side, but what do you mean by breaking spaces rather than tables? Davykamanzitalkcontribsalter ego 10:28, 25 July 2014 (UTC)Reply
It looks as if the template generates a WikiTable, and there appear to be no breaking spaces between the links. If there are breaking spaces (traditionally [space][bullet][non-breaking space] or [non-breaking space][bullet][space]), then Wikipedia's or HTML's normal line spacing breaks should take effect. That probably works within a WikiTable as well, but I'm more comfortable with boxes.
I should add that my construction with subtemplates is undoubtedly longer than yours, but it should be easier to maintain. (It's still probably impossible in WP:Visual Editor, but it should be easier to maintain with the conventional editor, if, for some reason, the internal tagging for multiple instances of the same section head change. — Arthur Rubin (talk) 16:34, 25 July 2014 (UTC)Reply
Point 2 is resolved, thanks. Point 3 was resolved by my removing "white-space: nowrap" from the style. I don't know about point 4; it may have something to do with the section headers, or there may be another style tag that would take care of it. I still think you should consider point 5. The addition of the month parameter would be much easier, and it is almost impossible to verify that the tag and the tag label are always the same. If each tag name and section were passed to a subtemplate, then that code would only have to be written once. As it stands, if someone were to vandalise the template to interchange the order of "section" and "section9", you'd never notice it if only the September links were soetimes screwed up . Shared code makes vandalism (or errors) less subtle. — Arthur Rubin (talk) 17:25, 25 July 2014 (UTC)Reply
@Arthur Rubin: I created the "month" parameter several hours ago as you may have noticed, but I'm still not 100% on the subtemplate since it can get a bit tricky sorting out the parameters but I'll give it a go. Davykamanzitalkcontribsalter ego 18:49, 25 July 2014 (UTC)Reply
@Arthur Rubin: I've tinkered with the subtemplate option and your code but for some reason whatever I try the ToC ends up showing the raw wikilink code instead of the wikilinks themselves. {{Births and deaths ToC/main}} is available so maybe you could experiment in the sandbox in your own time and see if you can come up with something. Davykamanzitalkcontribsalter ego 19:19, 25 July 2014 (UTC)Reply

End of year?

edit

For the current year, the options

{{BD ToC|deaths|section=2|months=9}} should work once we have both events and deaths in September, the 9th month. Perhaps we should take "it should be added at the end of the given year" out of the documentation? — Arthur Rubin (talk) 23:06, 31 December 2017 (UTC)Reply

Events

edit

As most recent year articles have the ToC limited, perhaps we should use this template to have a horizontal ToC for events, as well. — Arthur Rubin (talk) 23:27, 31 December 2017 (UTC)Reply

@Arthur Rubin: See discussion here. JoeNMLC (talk) 18:03, 18 September 2022 (UTC)Reply

problem reported via VRT

edit

In ticket:2024053010007963 it was reported that as seen on page 1933: I noticed that in the article for a given year, when you go to the Births section and click on a given month, it takes you to the Death section. That's because it's adding the _2 to the end of the URL. This happens for every year I try. Note that March is highlighted but the link at the bottom left has the _2

@Davykamanzi: it's been a while but you seem to be the primary author for this template, would you take a look? Thank you, — xaosflux Talk 16:20, 1 June 2024 (UTC)Reply
@Xaosflux: Haven't been actively editing templates for quite a while so I don't know if I'll be able to solve the issue, but I'll find some time and take a look. Davykamanzitalkcontribsalter ego 10:27, 6 June 2024 (UTC)Reply