Configuring the user interface — CubicWeb 3.13.2

### Navigation

- index
- modules |
- next |
- previous |
- CubicWeb 3.13.2 »
- Web side development »

# Configuring the user interface

## Relation tags

A RelationTag object is an object which allows to link a configuration information to a relation definition. For instance, the standard primary view uses a RelationTag object (uicfg.primaryview_section) to get the section to display relations.

    # display ``entry_of`` relations in the ``relations`` section in the ``BlogEntry`` primary view
    uicfg.primaryview_section.tag_subject_of(('BlogEntry', 'entry_of', '*'),
                                              'relations')

    # hide every relation ``entry_of`` in the ``Blog`` primary view
    uicfg.primaryview_section.tag_object_of(('*', 'entry_of', 'Blog'), 'hidden')

Three primitives are defined:
  - `tag_subject_of` tag a relation in the subject’s context
  - `tag_object_of` tag a relation in the object’s context
  - `tag_attribute` shortcut for tag_subject_of

## The uicfg module

Note

The part of uicfg that deals with primary views is in the Primary view configuration chapter.

This module (`cubicweb.web.uicfg`) regroups a set of structures that may be used to configure various options of the generated web interface.

To configure the interface generation, we use `RelationTag` objects.

### Index view configuration

indexview_etype_section:
| entity type category in the index/manage page. May be one of: `application` `system` `schema` `subobject` (not displayed by default)

### Actions box configuration

actionbox_appearsin_addmenu:
| simple boolean relation tags used to control the “add entity” submenu. Relations whose rtag is True will appears, other won’t.

    # Adds all subjects of the entry_of relation in the add menu of the ``Blog``
    # primary view
    uicfg.actionbox_appearsin_addmenu.tag_object_of(('*', 'entry_of', 'Blog'), True)

### Navigation

- index
- modules |
- next |
- previous |
- CubicWeb 3.13.2 »
- Web side development »