Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I'd like to place sections of articles into categories on Wikipedia. (for example, placing "Pollution in India#Water pollution" into the category "Water pollution in India") Is there any way to do this besides creating a redirect page for the article and then putting the redirect page in the category?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

First, let me say that I don't think doing this is a good idea. Category description pages on Wikipedia shouldn't contain article text, that's not what they're for. If you want to do this, make sure there is a consensus to do it. For some more information, see Creating category pages.

If you're sure you want to do this, I think the only way (ignoring custom or some existing extension) is to use template transclusion. This can be done two ways:

If you know that you'll always want only this specific section, you can enclose it in <onlyinclude> tag. Then you can transclude the article to the category page (e.g. {{:Pollution in India}}) and only this section will show up.

But if you want to transclude different sections of the same article to different categories, that won't work (unless you also added some {{#if}}s to the article, which I don't think is a good idea). What you can do then is to split the article into multiple parts, each within its own template. So, the text of the section Water pollution might be in Template:Pollution in India/Water. Then you can transclude that template to both the article and the category (using {{Pollution in India/Water}}).

share|improve this answer
    
Why isn't it a good idea to add {{#if}}s to the article? –  Anderson Green Jul 1 '12 at 14:53
    
"Normal" users should be able to edit articles. Because of that, articles shouldn't contain any overcomplicated markup. –  svick Jul 2 '12 at 11:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.