Hmm - here it is more precisely: I want a specific graphics file (or in some cases just a specific word) to display on a page if the page in question belongs to a specfic category.
The graphics file or the word is to be displayed inside a table. I called the table "templated" because it will in use on many different pages - and I have yet to learn a lot about Mediawiki :-)
kassoe
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Christensen, Courtney Sent: 14. august 2008 20:53 To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Best way to IF(category) THEN (display something)
Bjorn Kassoe Andersen wrote:
I want specific words and graphics to be displayed in a
templated box if a
page belongs to a specific category (if the page does not belong to
this
category, a default text/graphic should be displayed).
I think you could do it in a new skin for your wiki. You want a box somewhere on the page (a new div maybe?).
$cats = $wgTitle->getParentCategories(); If ( array_key_exists($specialCat, $cats) { //Words and text } else { //Just a logo }
That's assuming you don't mean what more experienced wiki people mean by 'templated'.
-Courtney
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l