You are browsing the documentation for iTop 3.0 which is not the current version.

Consider browsing to iTop 3.2 documentation

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>
3_0_0/customization/longname.txt ยท Last modified: 2022/01/21 16:52 by 127.0.0.1
Back to top
Contact us