0
votes

category links for which i haven't created custom pages are displaying as red links. i was under the impression that actually creating a page is optional for category pages.

a typical situation can be :

an article is called up.
one of the category links at the bottom of the page will be red.
clicking on the link will take me to a valid category summary.
clicking on another category link at the bottom of the article (a white one) will also take me to a valid category summary.
returning to the article, the second category link is now also red.

is there a way to tweak the wiki so category pages are displayed in white, regardless of whether they have a custom page created for them ?

the wiki is running MediaWiki 1.29.1.

2

2 Answers

0
votes

as it turns out, the problem was that the styling for a.new and a.new:visited appeared with a higher precedence than that for catlinks. unless the desire is to require every single wiki to have every single category be fully defined [i.e., providing a landing page for each category], this isn't a good approach.

one of the great powerful features of mediawiki is its capability that allows admins and maintainers to categorise articles as they wish without requiring them to create a landing page for every single category. however, if this is your goal, the styling won't support it as-is, due to this precedence problem. you can insist on precedence for catlinks however, by appending !important. although many people detract from the use of !important, this use case is pretty much textbook for the reason it was designed in the first place.

if your need is more in line w/that envisioned by the maintainers of the current mediawiki release [i.e., you want to have a hand-designed landing page for every single category and have no need for truly automatically-generated categories], this is a non-issue.

0
votes

The colors are set using CSS, you should create new CSS and add it to MediaWiki:Common.css to apply it to ask skins. If this page does not yet exist just create it.

The ‘.catlinks’ class controls the formatting of links to categories, and the colors for wanted pages are defined by the ‘.new’ class, eg a.new, a:new:visited.

The original code can be found in the mediawiki/resources/src/mediawiki.skinning/interface.css file. Just add CSS to fix the font colors to those you choose to Common.css, eg

 .catlinks,
 .catlinks a.new,
 .catlinks a.new:visited {
        color: #0645ad;
   }