Jump to content

Help:Category: Difference between revisions

From LabVIEW Wiki
No edit summary
Restructure the page
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
To add an article to a category put the following at the end of the page you are editing...
Categories group related pages. Each page can belong to zero or more categories. For example, this page belongs to the category "[[:Category:Help]]". Categories contain an index of pages in its category.


<nowiki>[[Category:{Name}]]</nowiki>
== How to add pages to categories? ==
There are multiple ways to add pages to categories.


where {Name} is the name of the category you want to add it to. Any number of category tags may be added to the page - the page will be listed in all of them.
=== Using the Category Assignment box of the page editor ===
When editing a page, the page editor has a '''CATEGORY ASSIGNMENT''' section with a ''Categories'' box to assign categories to a page. Start typing a category name to get a list of possible matches. It is also possible to create new categories by writing the category name manually.


You can also specify an additional {Sort} parameter that dictates where the page will appear, alphabetically, within the category. This is achieved by using the following markup:
=== As part of the page ===
Categories can be added directly to the page as part of the text. It is generally recommended to add categories at the '''end''' of a page, although technically categories can appear anywhere on the page.


<nowiki>[[Category:{Name}|{Sort}]]</nowiki>
==== Syntax ====
To add a page to a category put the following text at the end of the page:


So for example, to add this page to the 'Help' category, you would use:
<nowiki>&#91;&#91;Category&#58;{Name}&#93;&#93;</nowiki>


<nowiki>[[Category:Help|Categories]]</nowiki>
Where <code><nowiki>{Name}</nowiki></code> is the name of the category you want to add it to.


Note that we used 'Categories' as the sort parameter. Without this the page would be listed under 'H' for 'Help:Categories', instead of under 'C', which is more useful. Other situations where you might want to use the sort parameter is when you have articles about people that are titled as <code>FirstName LastName</code> but within the category you want them listed as <code>LastName, FirstName</code>.
==== Sorting ====
By default, pages will be sorted by their title. This can be problematic for pages inside namespaces. For example, "Help:Category" will be listed under "H" (for "Help") instead of "C" (for "Category"). This can be fixed by adding a sorting name as part of the category tag. Please note that this does not change the page title as it appears in the category. For example, this page appears under "C" (for "Category") but is still labeled "{{FULLPAGENAME}}".


Another way to sort the article in the correct letter without the namespace is
'''Important''': LabVIEW Wiki recommends the following notation when adding a category tag:


  <nowiki>[[Category:Help|{{PAGENAME}}]]</nowiki>
  <nowiki>&#91;&#91;Category&#58;Name|{{PAGENAME}}&#93;&#93;</nowiki>


This is extremly helpful when using templates which include a category tag.
This will automatically resolve the page name. <code><nowiki>{{PAGENAME}}</nowiki></code> is a magic word that is replaced by the page title - without namespace - automatically.


''Note: the {sort} parameter does '''not''' affect how the page title is displayed within the category listing, just how it is ordered.  In the above example, the link to this page will still be 'Help:Categories', and not 'Categories' as you might expect!''
[[Category:Help]]
[[Category:Help]]

Latest revision as of 16:49, 18 May 2020

Categories group related pages. Each page can belong to zero or more categories. For example, this page belongs to the category "Category:Help". Categories contain an index of pages in its category.

How to add pages to categories?

There are multiple ways to add pages to categories.

Using the Category Assignment box of the page editor

When editing a page, the page editor has a CATEGORY ASSIGNMENT section with a Categories box to assign categories to a page. Start typing a category name to get a list of possible matches. It is also possible to create new categories by writing the category name manually.

As part of the page

Categories can be added directly to the page as part of the text. It is generally recommended to add categories at the end of a page, although technically categories can appear anywhere on the page.

Syntax

To add a page to a category put the following text at the end of the page:

[[Category:{Name}]]

Where {Name} is the name of the category you want to add it to.

Sorting

By default, pages will be sorted by their title. This can be problematic for pages inside namespaces. For example, "Help:Category" will be listed under "H" (for "Help") instead of "C" (for "Category"). This can be fixed by adding a sorting name as part of the category tag. Please note that this does not change the page title as it appears in the category. For example, this page appears under "C" (for "Category") but is still labeled "Help:Category".

Important: LabVIEW Wiki recommends the following notation when adding a category tag:

[[Category:Name|{{PAGENAME}}]]

This will automatically resolve the page name. {{PAGENAME}} is a magic word that is replaced by the page title - without namespace - automatically.