Variants and inherited values
A class can let items take values from the item above them. A shirt holds the name, description and price. Its variants hold only what differs, such as the size and the code. Keel shows where each value comes from, and lets you override it or go back to the parent's value.
An administrator switches this on per class in Pimcore (Allow inheritance, Allow variants). Lists of other classes look as they always did.
In a list
A list shows items, not variants. The menu count, the chips and the pages count items too.
- A row with variants has a small arrow and a number by its name. Click it to open the variants under the row. They have the same columns and actions as any row, and you can tick them for bulk changes.
- A row opens at most 200 variants. With more, a link under them opens the item, and its Variants tab has them all.
- A value a row takes from its parent is shown muted, with a ↳ in front of it.
To work with variants across a whole list, use Filter and pick Variants:
- shown with their items: items and variants together.
- only variants: for example, all variants with size M.
The filter works with the other filters, search, sorting, Select all, bulk changes, Export and saved views.
The list's search looks at variants only with this filter on. The search at the top of Keel finds them by key.
In the editor
An item with variants has a Variants tab, with Add for a new one. Fields you leave empty on a new variant take the parent's value, and so does a box you leave unticked.
A variant, or any item with a parent of its class, shows its parent under the header. Under each field you see one of these lines:
| Line | Meaning |
|---|---|
| Inherited from Shirt | The field is empty here. The value comes from Shirt, which may be further up than the direct parent |
| Overrides the value of Shirt | This item has its own value. Use parent value takes it back to Shirt's on saving |
| Inherited from an item you can't open | The field has a value that your rights don't let you see |
To override a value, type over it and save. A value equal to the parent's stays inherited.
Empty is what makes a field inherit, so a field can't be empty on purpose while its parent has a value. A number 0 and an unticked box are values of their own.
Changing a parent's value changes every variant that inherits it, right away, and scores them again if the class has a completeness rule.
Bulk changes
Set field works on variants like on any item. Next to Apply, Use parent value takes the field of the selected items back to their parents' values. An item without a parent is listed as not changed, and an item that already inherits gets no new version. Both can be undone in History.
Move to… lists variants as not changed: a variant stays under its item.
Bricks and classification stores show the same lines for each field and attribute: see Bricks and attributes. Field collections don't inherit in Pimcore, so a variant's collection is its own.
History
History shows what the item held itself, so an inherited value is no change of the item. Restoring a version where a field was empty makes it inherit again.
What you see of a parent you can't read
A value shows only if you may read it where it is stored: you may open that item, the field is not hidden for you there, and you may see the language.
- In the editor the field stays empty and says so. The name of that item is not shown. You can still type your own value, and the page preview is off.
- In a list such a row shows only what it holds itself. Search and field filters leave it out, and the list can't be sorted by a field, because the order would tell what the parent holds. Export follows the list.