Thread:Project:Support desk/is the current page in a special category?/reply (4)

Ahh, I somehow missed the last part of the expression. Anyways, "if the page is not in category x, then put it in category x" only is a weird way of writing things, but it is no contradiction. Before this line is parsed, MediaWiki does not know the page is in the cat, but after it is parsed, it does know. Adding the category to the page in the normal way also adds it to the category and if you try to put the same page into the same category a second time, then this second category also will do nothing at all - just like the condition in your example won't add the page to the category again, if it already is in it. Apart from that Paul never said that based on the "is in category" condition he wanted to put the page in exactly this category. I see a row of valid usecases there. So why is what he is trying to do not working?

Possible answers I could think of are: Because this condition is just not implemented (I have not found any documentation of #isincategory:). Or: At the time the above code is executed, MediaWiki just does not (or not yet) know, which categories the article is in.