Topic on Project:Support desk

Jump to: navigation, search

How to remove a standard text in category page!

18 (talkcontribs)

So I use categories at my website! So I have created a category for example "Category:Mycat", there is a standart text which cannot be removed: Pages in category "Mycat" The following 2 pages are in this category, out of 2 total.

So how can I remove it?

SVG (talkcontribs)

With CSS. (talkcontribs)

What css file should I edit for it? I thought that I should edit one of those php files

SVG (talkcontribs)

Editing an PHP file is more recommendable. The file to edit can be found in /includes folder, but I don't know the file. Shouldn't be hard to find it. (talkcontribs)

Yes I tried to find it there. I havn't found it yet. If you know where it is let me know! (talkcontribs)

You should really do that with CSS. Tim surely did not want to tell you that it would be better to edit the PHP files (which it is not).

SVG (talkcontribs)

No, it is kinda better to edit the PHP files if you are not upgrading with SVN or Git because CSS needs to be loaded and this takes its time even it's quite short. The easiest way is of course CSS. You can disable it in MediaWiki:Common.css.

Krinkle (talkcontribs)

@Tim: Ah, so you just assumed that the thread starter doesn't use SVN or Git. And that he/she knows to keep track of core hacks and knows where, when and how to re-apply them after every update and upgrade (be it with SVN/Git, or through zips/tarballs, or through some package manager).

Please never recommend hacking core PHP files again. Especially not to a relatively new developer with the software or with development in general.

If you must use PHP, create an Extension and investigate the power of Hooks or maybe create a custom skin

Or if it is possible with a bit of CSS, use Site CSS on the wiki.

SVG (talkcontribs)

@Krinkle: I assume(d) that every runner of a wiki who uses Git or SVN knows that files either shouldn't be edited or should be deleted before upgrading the wiki. (talkcontribs)

I have tried to hide this part using css, but I guess it is not possible to hide this <div id="mw-pages">, because it hides all content of the category (talkcontribs)

I would be glad to use both possibilities! But I don't know yet what exactly I should change in php file or css. I have searched through all php files and I didn't find where it can be done! CSS is also posibble, but I don't know what should I mark as "display: none;" to hide what I need! Hope you can help me! (talkcontribs)

Here is the link to my category:

and I want to remove this part: Pages in category "English A" The following 3 pages are in this category, out of 3 total. A

I tried to hide it using css, but all were hiden ... may be I should do it in other way? PLease help! (talkcontribs)


 body.ns-14 mw-pages p {
     display: none;
 } (talkcontribs)

It doesn't work ((( (talkcontribs)

Maybe it does not work, but you got the idea, right? Use a tool like Firebug to see, how exactly your rule must look like. (talkcontribs)

I got the idea, but there is a problem how html mark this part of the code. Here it is

<div lang="en" dir="ltr"><div id="mw-pages">
<h2>Pages in category "English A"</h2>
<p>The following 3 pages are in this category, out of 3 total.
</p><div lang="en" dir="ltr" class="mw-content-ltr"><h3>A</h3>
<ul><li><a href="/index.php/Akon" title="Akon">Akon</a>

This part I need to be displayed:

<ul><li><a href="/index.php/Akon" title="Akon">Akon</a>

So I tried to hide this "mw-pages" using your method and all was hidden including the content that I need to be displayed! So I don't know how to find a solution! (talkcontribs)

You have written

#mw-pages {
     display: none;


Sure, this will just hide that container (and so most of your wiki page).

What you want is to only hide "p" tags inside the element with the ID mw-pages. By the way: I just noted that my code was not completely correct; you would have to use

body.ns-14 div#mw-pages p {
     display: none;

(again untested, but hopefully). (talkcontribs)

Thank zou very much! I got and it works 100%. I have hidden all that I wanted!

Reply to "How to remove a standard text in category page!"