Template talk:Educational institutions establishment category by century

Latest comment: 3 years ago by Tom.Reding in topic 15th century bug

15th century bug

edit

@BrownHairedGirl, Dpleibovitz, Colonies Chris, J-beda, Izno, Paine Ellsworth, Koavf, and Primefac: I've pinged some people who haven't worked on this template because I think you are good at solving problems with linty templates. This template misbehaves for Category:Educational institutions established in the 15th century, displaying a small empty box to the left of the "Contents" heading and generating 2 missing end tags and 2 stripped tags for <div>. Other than this one category, it seems to behave normally. —Anomalocaris (talk) 23:45, 15 March 2021 (UTC)Reply

An initial look hasn't shown me anything obvious. It appears more likely to be an issue with {{CatAutoTOC}} rather than {{Eiei-century}}. I'd suggest changing the century range as an experiment - instead of cutting off at 1500, try 1400 instead. The outcome of that experiment will establish whether the problem is caused specifically by the 15th century data, or it's a problem with the first century in the range. Colonies Chris (talk) 18:46, 16 March 2021 (UTC)Reply
@Colonies Chris: see my long rely below. The reason that it applied only to the 15th century is that no other century has a TOC. --BrownHairedGirl (talk) • (contribs) 05:28, 2 April 2021 (UTC)Reply

Hi @Anomalocaris, Dpleibovitz, Colonies Chris, J-beda, Izno, Paine Ellsworth, Koavf, and Primefac: sorry for being v slow to respond to the ping ... but it's now fixed.[1] Short story: I removed the indent from the first line of the transcluded {{Eiei-cutoff}} notice.

Long story: I created {{CatAutoTOC}} and rewrote {{Eiei-century}} to a parameterless format. So this is the intersection of two templates I built.

When I looked at this, I recalled that I had found a similar problem before, where in some circumstances {{CatAutoTOC}}'s output got mangled, and it took me ages to find a fix. Revisiting it a year later, it took me a while to recall what exactly the cause was.

The issue is that both templates are designed to be as vertically compact as possible, to minimise the degree to which the category listing is pushed down below the fold. The downside of this is that in some rare circumstances this causes the Mediawiki software's HTML tidy software to mangle the output of both templates into a combination which causes trouble.

The precise situation which causes trouble is when these two conditions both apply:

  1. the cathead template includes text below the {{Navseasoncats}} navbox
    and
  2. that text is indented.

When those two conditions apply, HTML tidy produces a strange quirk of markup which breaks the CSS for the navigation TOC: the browsers try indenting the TOC box, and somehow fail screw up all the styling. The various en.wp stylesheets are so complex that I can't figure exactly what happens under the hood.

But the solution is simple: do not indent any text which appears under the {{Navseasoncats}}, 'cos the indent will break the category.

The reason it occurred only on Category:Educational institutions established in the 15th century is simple: the 15th-c is the only century in this series which has enough pages to trigger a category TOC. Earlier centuries have less content, and later centuries are diffused by decade ... so none of them has a TOC to get mangled.

If complex template issues like this arise again and I am not around, one good person to ask is @Pppery, who has wizard capabilities with templates and Lua modules. --BrownHairedGirl (talk) • (contribs) 05:23, 2 April 2021 (UTC)Reply

BrownHairedGirl: Thank your for fixing it and for the explanation! —Anomalocaris (talk) 07:21, 2 April 2021 (UTC)Reply
Yes, yet another awesome fix! P.I. Ellsworth  ed. put'r there 11:02, 2 April 2021 (UTC)Reply
  I fixed it. Let there be indents.   ~ Tom.Reding (talkdgaf)  15:47, 8 April 2021 (UTC)Reply