Skip to the content
Documentation

Grouping attributes

No ratings yet

A long edit form is easier to work with when the fields editors rarely need are tucked away. Each field of a class has a category. Fields of the default category are shown in the form as usual; the fields of every other category are gathered in a group of their own at the end of the form, closed until an editor opens it. The demo classes use this for their Meta fields, such as the SEO meta data, the CSS class and the URL text.

Who can do this

Choosing a field's category: users whose role has the class policies. Adding a new category: whoever manages the settings files on the server.

Put a field in a category

  1. Open Setup, Classes and click the class. Each field's card names its Category.
  2. Click Edit. In the field's card, choose the Category: Default (Content), Content, Meta or another category of your site.
  3. Click OK.
The card of the Meta Data field on the NG Article class page, with its category Meta

Each field of a class has a category. The Meta Data field of NG Article is in the category Meta; most fields keep the default, Content.

In the edit form, the fields of the Meta category now sit in the group Meta at the end; click its name to open or close it. On a long form, the field bar at the top still links to every field, and a link to a field in a closed group opens the group. The website sidebar's Page panel groups the fields the same way.

The Meta group at the end of an article's edit form, holding the Meta Data field

Fields of the Meta category are shown together in their own group at the end of the edit form; click the group name to open or close it.

The categories of a site

The categories are listed in content.ini [ClassAttributeSettings] CategoryList[], as identifier and name, and DefaultCategory names the one used for fields without a category. Shipped:

[ClassAttributeSettings]
CategoryList[]
CategoryList[content]=Content
CategoryList[meta]=Meta
DefaultCategory=content

To add a category, an administrator adds a line such as CategoryList[shop]=Shop in settings/override/content.ini.append.php (an identifier of at most 25 characters) and clears the INI caches. The new category is then offered in the class editor.

What can go wrong

  • A required field is in a closed group. Editors may not notice it. Keep required fields in the default category, or tell editors about the group.
  • A category vanished. It was removed from CategoryList[]; its fields are shown in the default category.

Read more

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.