Topic on Project:Support desk/Flow

AnonymusGdpr (talkcontribs)
Software 	Version
MediaWiki 	1.31.1
PHP 	7.2.10-0ubuntu0.18.04.1 (apache2handler)
MySQL 	5.7.24-0ubuntu0.18.04.1-log

We are used to place a template at the bottom of a page, to change the sort order. We place all categories at the end of the page and put the template after the last category. If there is a blank line between category and template, then the result is an unaesthetic space before the category. See here: https://test.perrypedia.proc.org/wiki/Example1

No problem. So we remove the blank line and everything's fine: https://test.perrypedia.proc.org/wiki/Example2

If we do the same with a redirect, it doesn't work: https://test.perrypedia.proc.org/mediawiki/index.php?title=Example3&redirect=no

So we need to remove the newline between category and template: https://test.perrypedia.proc.org/mediawiki/index.php?title=Example4&redirect=no

This is of course a minor issue. At least it is odd that the "space before category"-behaviour depends on whether it is a redirect or not?

Ciencia Al Poder (talkcontribs)

Categories and interlanguage links produce no output. However, having a line with only category links renders as an empty line, which usually means it's a new paragraph. MediaWiki automatically trims empty text at the end of the page, and this works perfectly when categories are at the end of the page, but not if there's a template below the categories, because it produces output that's not trimmed. The defaultsort parser function works wherever you put it on the page, so ideally you should always leave your categories at the end.

AnonymusGdpr (talkcontribs)

We do so now and it works fine, thanks.