This project is read-only.

Package Description

The categorisation package allows Umbraco users to add, delete and organise categories within the Umbraco interface. These categories could then be used to categorise pages using the built-in Category Tree data editor.

Category Selection Data Type

The category selection data type will be created automatically when installing the Categorisation package. The data type uses the render control Category Tree.

Add this data type to your document types. It’s recommended that the data type is put within its own Tab, especially if you intend to display all categories.

Managing Categories

Once installed, the Settings section tree will have a new node. Within the new Categories node you can Create, Delete and Sort categories. Clicking on a category will bring up the edit page for the selected category.

Hierarchical category layout is supported; just right click on a category and click ‘Create’ and this will create a child for that category.

Category Helper Methods

By referencing the Auros.Categorisation assembly in your projects you gain access to a number of Helper methods to make working with Categories on Nodes simpler.

These methods can be found within the static class Auros.Categorisation.NodeHelpers.

Get Nodes in Category

Description Returns an array of Node objects which have the specified category within the property with the specified alias.
Method(s) GetNodesInCategory(string propertyAlias, Category category, int rootId = -1)
GetNodesInCategory(string propertyAlias, int categoryId, int rootId = -1)
Return Type Node[]

Node Has Category Assigned

Description Returns true if the node has the category assigned to it within the property with specified alias.
Method NodeHasCategoryAssigned(Node node, string propertyAlias, int categoryId)
Return Type Node[]

Get Descendant Nodes

Description Returns a collection of Node objects which match the specified filter function.
Method GetDescendantNodes(Node node, Func<Node, bool> func, bool includeDescendantsOfNonMatches)
Return Type IEnumerable<Node>

Get Categories for Node

Description Returns a collection of Category objects which are found within the specified property of the Node.
Method GetCategoriesForNode(Node currentNode, string propertyAlias)
Return Type IEnumerable<Category>

Category XSLT Extensions

Type Auros.Categorisation.XsltExtensions
XSLT Namespace Categories

Get Category Name

Description Returns the name of the category with the specified ID.
Method GetCategoryName(ushort id)
Return Type String
Example Value "Food and Drink"

Get Category

Description Returns the category with the specified ID.
Method GetCategory(ushort id)
Return Type XPathNavigator
Example Value
<category id="1" parent="0" enabled="True" selectable="True">
  <name>Food and Drink</name>
  <description>Articles relating to food and drink.</description>
</category>

Get Categories

Description Returns all enabled categories.
Method GetCategories()
Return Type XPathNavigator
Example Value
<categories>
  <category id="1" parent="0" enabled="True" selectable="True">
    <name>Food and Drink</name>
    <description>Articles relating to food and drink.</description>
  </category>
</categories>

Get All Categories

Description Returns all categories, including disabled.
Method GetAllCategories()
Return Type XPathNavigator
Example Value
<categories>
  <category id="1" parent="0" enabled="True" selectable="True">
    <name>Food and Drink</name>
    <description>Articles relating to food and drink.</description>
  </category>
</categories>

Get Child Categories

Description Returns child categories of the specified parent ID.
Method GetChildCategories(ushort parentId)
Return Type XPathNavigator
Example Value
<categories>
  <category id="1" parent="0" enabled="True" selectable="True">
    <name>Food and Drink</name>
    <description>Articles relating to food and drink.</description>
  </category>
</categories>

Get All Child Categories

Description Returns all child categories of the specified parent ID, including disabled.
Method GetAllChildCategories(ushort parentId)
Return Type XPathNavigator
Example Value
<categories>
  <category id="1" parent="0" enabled="True" selectable="True">
    <name>Food and Drink</name>
    <description>Articles relating to food and drink.</description>
  </category>
</categories>

Get Categories from CSV

Description Returns all child categories of the specified parent ID, including disabled.
Method GetCategoriesFromCSV (string csvString)
Return Type XPathNavigator
Example Value
<categories>
  <category id="1" parent="0" enabled="True" selectable="True">
    <name>Food and Drink</name>
    <description>Articles relating to food and drink.</description>
  </category>
</categories>

Last edited Oct 11, 2013 at 9:29 PM by noaveragegeek, version 8

Comments

No comments yet.