Every item in your directory has a category: Site, Area, Vehicle, or whatever your organisation calls that level. The category gives a level its name and its colour, so people can tell at a glance what kind of thing they're looking at.
What a category is
A category is the kind of thing an item is. In a tree of sites, areas and locations, each of those is a category, and every item belongs to exactly one. Pyron uses the category's name as the word for each item, so menus and dialogs talk about adding or editing a Vehicle rather than a generic item. For how categories fit into the directory as a whole, see The directory.
Because categories mark levels, Pyron keeps them in order as the tree grows:
- No repeats down a branch. An item can't take a category that any item above it already uses, so a site can't sit inside another site.
- Siblings can share. Several children of one parent can have the same category, such as many areas under one site, and one parent can hold children of different categories side by side.
- Levels stay in sequence. A category used further down a branch isn't offered at a higher level of that same branch.
- One tree per category. Once items in one tree use a category, no other tree can use it. A new top-level item can only take a category that no tree uses yet, so give each tree's levels their own names.
Category names are unique across your organisation. Within one parent, two items of the same category also need different names.
An item's category is set when you add it. The edit dialog shows the category but doesn't change it, so choose carefully when you add the first item at a new level. Designing your tree helps you plan the levels before you start.
Creating and editing categories
You create and manage categories from the category picker in the add dialog, so a new level comes into being the moment you first need it. Whether you can create, edit or delete categories depends on your role; see Roles and permissions.
Create a category
- In the directory, open the actions menu on the item that will hold the new level. To start a new tree, add a top-level item instead (see Adding an item).
- Choose to add an item of a new category. The add dialog opens with a category picker.
- Open the category picker. The option to create a new category sits at the top of the list.
- Enter a name for the category.
- Choose a Colour: pick one of the swatches, use the colour picker, or type a hex code such as
#0EA5E9. Pyron starts you off on a palette colour no other category uses yet. If another category already has the colour you choose, the form names it beneath the field — see Choosing colours that work. - Choose Create category. The new category is selected in the picker, ready for the item you're adding.
Rename or recolour a category
- Start adding an item at the level where the category is used. The picker lists only the categories allowed at that spot, so add under the parent of an existing item of that category.
- Open the category picker and select the edit (pencil) icon beside the category.
- Change the name, the colour, or both, and choose Save. As when you create one, the form warns you if another category already has the colour.
- Close the add dialog if you don't want to add an item.
The change applies everywhere the category is used: every item of that category takes the new name and colour.
Delete a category
Select the delete (bin) icon beside the category in the picker, then confirm. Pyron only deletes a category that no item uses.
Colours in the tree
A category's colour follows its items through every view of the directory, so the same kind of thing looks the same wherever you meet it.
In the tree view, a category box moves as one when you rearrange the layout; see Arranging the tree.
Choosing colours that work
- Give every category its own colour. Colour is how the directory tells one kind from another at a glance, so two categories on one colour look like the same kind everywhere. The category form tells you when the colour you've picked is already taken, and by which category — across every tree, not just the one you're adding to. It's a warning, not a block: you can keep the colour if you mean to.
- Keep neighbours distinct. Children of different categories under one parent each get their own box, so give categories that sit side by side clearly different colours.
- Avoid very pale colours. A category box is a light wash of its colour, and a pale colour can all but disappear against the tree's background.
- Let Pyron handle contrast. Pyron adjusts label text and edges so they stay readable in both light and dark themes.