Help:Category Queries

From QED

Revision as of 17:24, 4 May 2009 by Peak (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

The special page Special:CategoryQuery supports category queries based on category overlaps, where, however, each category in effect is viewed as the set of articles, images and other media files that are in the specified category or in one of its direct or indirect subcategories.

For example, the query "Map" would find not only all the pages that have been explicitly tagged as belonging in Category:Map, but also pages that have been only explicitly tagged as belonging to Category:Historical Map.

Special:CategoryQuery can be used in several ways:

  • to generate a page with the results of a category query;
  • to produce an input query form with all QED categories;
  • to create your own category query input forms with one or more selection boxes.

Contents

Notes for Readers

First select one or more categories from the selection box(es), and then press the Go button. An index page will be generated. If there are any images in all the selected categories, the index page will include an image gallery.

See Help:Keyboard for details about the mechanics of selecting multiple items from a selection box using the mouse and keyboard.

Queries involving Time Periods

The effect of specifying a time period in a category query is to restrict matches to those pages which are classified as being in that time period or a narrower one. For example, if a hypothetical article on the Cuban Missile Crisis were placed in a hypothetical 1960s category, then a category query for all pages in Category:20th Century would include the article.

Notes for Editors

There are two ways to create Category Query pages: the direct method, and the page-based method.

Direct Method

The simplest way to specify a small number of categories is to use the form:

  {{Special:CategoryQuery/==Heading One== C11, C12,...; ==Heading Two== C21,C22,...}}

where:

  • each Cij may be '_' or the name of a category, optionally prefixed by one of the following directives:
    • empty= (to show it in GrayText and to prevent the category from being selected)
    • heading= (to highlight the text while preventing it from being selected)
    • hidden= (to hide the category)
    • selected= (to show it initially as selected);
  • each Cij may also be a string of the form "===Subheading===" signifying that the specified text is to appear as a grayed out subheading on the input form;
  • each group of categories separated by semi-colons corresponds to a single selection box;
  • all the headings may be omitted.

The result will be a group of selection menus as illustrated below. If a category is hidden, it is always selected.

The limit on the number of categories that can be specified using this method is determined by certain limits on the length of URLs.

If '_' is used in place of a category, a blank line will appear in the corresponding place in the menu.

Page-Based Method

The most general method uses a QED page to specify the menus using the same syntactic form as above. If the page is named X (e.g. User:Tiger/Menus) then one would specify: {{Special:CategoryQuery/page=X}}

The page itself should begin with the same kind of specification:


==Heading 1.0==
 C11, C12,...;
==Heading 2.0==
 C21, C22,...,
===Subheading 2.1===
C211, C212,...,
===Subheading 2.2===
C221, C222,...;
==Heading 3.0==
C31, C32, ...

Newlines and spaces may be placed before and after each punctuation mark. Only text up to the first occurrence of ---- will be considered.

Options

Options may be specified by appending a string of the form &name=value to the query.

To specify the maximum number of options to be displayed within a single selection menu, use the maxsize parameter as illustrated in the second example below.

Examples

{{Special:CategoryQuery/Map,World Map;Africa, Americas, Asia, Europe, Oceania}}

{{Special:CategoryQuery/page=User:Tiger/CategoryQueryMenus&maxsize=30}}

The first example produces the following result:


Select any number of categories from the following menus:help

Category Query Results

To create a link to a specific category query, use the form:

  [{{fullurl:Special:CategoryQuery|query=C1,C2,C3,...}} Conjunction of C1 & C2 & C3 ...]

When rendered, the above looks like this:

Conjunction of C1 & C2 & C3 ...

See also

Personal tools