Sidebar

Using iTop

Creating your iTop

iTop Customization

"How to" examples
DataModel

User Interface

Automation & Ticket management

Portal Customization

How to differentiate homonyms

Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.

learning:
Specify complementary attributes to differentiate homonyms
level:
Beginner
domains:
XML
min version:
3.0.0

The iTop 3.0 brings new capabilities to differentiate homonyms.

It must be specified in XML on the class for which you want other attributes than the friendlyname to be displayed when selecting them in a drop-down list.

Here is an example of what can be done on the Person class and how it is displayed:

Now that you have seen the layout, here is how it can be done in XML:
Notice that there are more lines than needed for the modification, but this is to show what can be modified in iTop 3.0 datamodel

itop-design / classes / class@Person
    <properties>
      <naming>
        <attributes>
          <attribute id="first_name"/>
          <attribute id="name"/>
        </attributes>
        <complementary_attributes  _delta="force">
           <attribute id="email"/>
           <attribute id="org_name"/>
        </complementary_attributes>
      </naming>
      <fields_semantic>
        <image_attribute>picture</image_attribute>
        <main_color/><!-- Main color for the class in css format.-->
        <complementary_color/>
      </fields_semantic>
      <style>
        <icon>../../images/icons/icons8-person-female.svg</icon>
      </style>
    <...>  

Note that using the field org_id does display a number, rather useless for iTop users, so better specify org_name which is human readable.

It's possible to specify with a dictionary entry a format for the complementary fields, like this:

itop-design
  <dictionaries>
    <dictionary id="EN US" _delta="must_exist">
      <entries>
        <entry id="Class:Person/ComplementaryName" _delta="force"><![CDATA[%1$s - (%2$s)]]></entry>
      </entries>
    </dictionary>
  </dictionaries>
latest/customization/longname.txt ยท Last modified: 2023/07/21 10:19 (external edit)
Back to top
Contact us