What is Category Set?
The category set is a technique to help categorize the information in the system.
Category Set plays two basic roles.
- Manage Categories Linearly or Recursively
- Help others to categorize information
This is very useful for managing any type of category effortlessly. Category sets are created through XML files containing all necessary configurations. Below are the methods to create a category set.
Method 1: Work in the base framework
All the files are typically saved in the below location
development/definition/cateogry_set
Here are some important points to follow:
- Each XML file is considered a category set.
- The name of the XML file is considered the categorySet name.
To create a category set, simply create the XML needed in the above location, and it's ready to use. See below example:
Below is some common fields information to keep in mind
Tag | Description | Example |
---|---|---|
title | Title of the category set | Blog Category |
admin_tab | The interface builder tab to render the UI | blog |
description | Enable/Disable description field | Yes |
image | Enable/Disable Image | Yes |
haschild | Enable/Disable sub category | Yes |
generic | Enable/Disable an additional field. Title help to define name of the field | Yes |
Click here to find more about field definition.
Now, the category set needs to be accessed from the admin pane. Below are the access links to manage the data in the category set
Type | Convention | Example |
---|---|---|
Add Entry | category/manage/[name]/add/td> | category/manage/blog-cat |
Manage Entries | category/manage/[name] | category/manage/blog-cat |
* [name] is a category set name. More about the access link is here.
Through Interface Builder, the UI can be accessed from the admin panel. Follow the below XML to add the menus.
A component always keeps all its resources isolated in the component folder. So the XML file should be placed inside the working component directory. See below for the path.
component/[component name]/category_set
For example, if the component name is “appbog” and the category set name is "blog-cat," then the file should be created in the below location:
component/[component name]/blog-cat
After file creation is done, the category set needs to be registered in the component through the callback method in the next two steps.
Step 1: Register the Callback
Step 2: Execute the callback
Function Reference
It is always expected that Framework can access data and use it. Below are the methods that help to work with cateogry set through programming.
Find | FindByField | findAll |
findAllByField | Listing | getRecursive |
Parents | Tag | Save |
Summary
As a CMS tool it helps to manage category through an auto-generated interface. Let's recap.
- First, create the XML file with all the required fields.
- Second, if it’s a component, create the file inside the component directory; otherwise, in the development area.
- Finally, set the menu in the admin panel to access the user interface and manage data.
Important: All data in the category set is driven by the mode Category. So that can be accessed through this model as well.