Jump to content

Topic on Project:Support desk

Remove (empty) for Subcategories list

5
Rshoskins71 (talkcontribs)

Again I am new working in Media Wiki. Is there a way to remove the (empty) from the Subcategory list created on a Category page. It seems when they created this category they used subcategories without pages. Any help would be appreciated. I will probably have more questions later.

sub-cat
Samwilson (talkcontribs)

@Rshoskins71: Do you mean you want to remove the bit that says "(empty)" from the list, or remove the subcategory from the list entirely? For the latter, you can go to that subcategory's page and delete it.

Rshoskins71 (talkcontribs)

Just the bit that says (empty) if possible. Our IT department just upgraded our wiki from 1.33 to 1.42.1. and it didn't used to have the (empty) message.

Ammarpad (talkcontribs)

It's not meant to be removable, but you can try this partially working hack if you really need to.

The word 'empty' itself comes from MediaWiki:Categorytree-num-empty. If you blank that page (i.e edit and save the page with nothing) the word will disappear from that place. However the parentheses will remain.

To remove the parentheses, edit MediaWiki:Categorytree-member-num and remove the parentheses there; but do note that, in cases where the subcategories are not empty, their total count will now be shown without parentheses.

Alternately, you can also blank that second page completely, meaning youll get rid of the 'empty' label and the parentheses issue fully but also lose the count for the cases where they're not empty.

Jonathan3 (talkcontribs)

You could do it by adding this to MediaWiki:Javascript

$(document).ready(function() {
  $("span:contains('(empty)')").hide();
});

As it stands it lacks discrimination, as it'll hide any span containing the text "(empty)", but I'm sure that could be changed if you think it will be a problem.

Reply to "Remove (empty) for Subcategories list"