Topic on Project:Support desk

Jump to: navigation, search

How to remove a standard text in category page!

18
79.164.222.118 (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.

79.164.222.118 (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.

213.87.134.40 (talkcontribs)

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

88.130.94.190 (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.

213.87.134.40 (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

213.87.134.40 (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!

79.164.222.118 (talkcontribs)

Here is the link to my category: http://www.allwikilyrics.com/index.php/Category:English_A

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!

88.130.85.69 (talkcontribs)

Use

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

It doesn't work (((

88.130.85.69 (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.

213.87.134.201 (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!

88.130.85.69 (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).

79.164.222.118 (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!"