Community Central
Community Central
No edit summary
mNo edit summary
Line 11: Line 11:
   
 
::So is there any code to return the count of a particular name space within a category so we can take that figure from the total? [[User:OllieMartin|OllieMartin]] 11:55, September 12, 2010 (UTC)
 
::So is there any code to return the count of a particular name space within a category so we can take that figure from the total? [[User:OllieMartin|OllieMartin]] 11:55, September 12, 2010 (UTC)
  +
  +
:::If you have the Semantic MediaWiki extension enabled, <code><nowiki>{{#ask:[[Category:Categoryname]][[:+]]|format=count}}</nowiki></code> should return the number of main namespace pages in the category. {{User:Ose/Sig}} 14:53, September 12, 2010 (UTC)

Revision as of 14:53, 12 September 2010

Forums: Index Community Central Forum Returning the ACTUAL number of pages in a category
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 4968 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


How can I return the ACTUAL number of pages in a category? Using the {{PAGESINCATEGORY:...}} template returns the number of pages AND the number of sub-categories in a category. E.g: this template uses the code {{PAGESINCATEGORY:Disease}} and returns (currently) 121. But the actual category has 105 pages and 16 sub-categories.

Any ideas how to exclude the sub-categories without just using {{#expr: {{PAGESINCATEGORY:Disease}} - 16 }} as this will not be true once new sub-categories are added. Thanks OllieMartin 11:04, September 12, 2010 (UTC)

The problem is, MediaWiki considers a sub-cat a page, and thus a member of the category -- RandomTime 11:30, September 12, 2010 (UTC)
So is there any code to return the count of a particular name space within a category so we can take that figure from the total? OllieMartin 11:55, September 12, 2010 (UTC)
If you have the Semantic MediaWiki extension enabled, {{#ask:[[Category:Categoryname]][[:+]]|format=count}} should return the number of main namespace pages in the category. Ose TalkContribs 14:53, September 12, 2010 (UTC)