Hi,
What is the best approach to support styling MW pages based on the category (categories) the page belongs to?
I was hoping the category name could be inserted in the class attribute just like the namespace and pagename appear there, but I did not find any configuration setting indicating that this is possible at the moment.
Thanks in advance for your suggestions.
Jean-Marc,
Yes it is. See http://handleiding.wikiation.nl/MediaWiki:Common.css for the definition and http://handleiding.wikiation.nl/Niveau_2_infobox_gebruiken for the implementation of that definition.
I use it to mark pages with a "Timecode". Normal pages are "now", but some are "Timecode-future". The content is written but not yet implemented in the real live. So I add this category. If the content is "now", the only thing I have to do is remove the category.
But be aware. A category may have multiple parents in MediaWiki. If you use multiple parents AND you use multiple styles, then the result will be unpredictable.
Good luck.
Bernard
Jean-Marc van Leerdam wrote:
Hi,
What is the best approach to support styling MW pages based on the category (categories) the page belongs to?
I was hoping the category name could be inserted in the class attribute just like the namespace and pagename appear there, but I did not find any configuration setting indicating that this is possible at the moment.
Thanks in advance for your suggestions.
Hi Bernard,
2010/1/27 Bernard@bernardHulsman.nl bernard@bernardhulsman.nl:
Jean-Marc,
Yes it is. See http://handleiding.wikiation.nl/MediaWiki:Common.css for the definition and http://handleiding.wikiation.nl/Niveau_2_infobox_gebruiken for the implementation of that definition.
I see the cat-foo entries appearing in the html, so obviously you have it working. Which MediwWiki version is needed for this feature, or is it done through one of the extensions you have on handleiding.wikiation.nl?
But be aware. A category may have multiple parents in MediaWiki. If you use multiple parents AND you use multiple styles, then the result will be unpredictable.
Yes, of course having a page in multiple categories that drive styling can lead to hard to predict outcomes, but for my purposes that will not be an issue.
mediawiki-l@lists.wikimedia.org