Configuring Displays

From CollectiveAccess Documentation
Jump to: navigation, search

Displays allow users to access and view selected metadata in a summary-style setting. They can be used to generate reports and provide information to users with read-only access. Displays can be configured through the User Interface at any point during a project, but it is most efficient to go ahead and set them in the profile before installing.

The basic code for displays is as follows:

<display code="object_display" type="ca_objects" system="1">
      <labels>
        <label locale="en_US">
          <name>Object Summary</name>
        </label>
      </labels>
      <bundlePlacements>
        <placement code="metadata_element">
          <bundle>ca_objects.element</bundle>
        </placement>  
      </bundlePlacements>
    </display>

Displays are configured similarly to user interfaces in that they require you to place your desired bundles. However, the syntax is slightly different, because you must include the table as well as the element code. So, instead of

<placement code="ca_attribute_description">
              <bundle>ca_attribute_description</bundle>
            </placement>

which you might see in the user interface configuration, you would have:

<placement code="ca_objects.description">
              <bundle>ca_objects.description</bundle>
            </placement>

To pull related records into your display, you simply need to express the desired table in your bundle placement:

<placement code="entities">
          <bundle>ca_entities</bundle>
        </placement>

You can further refine your displays by using various settings within the bundle placement:

<placement code="entities">
          <bundle>ca_entities</bundle>
          <settings>
            <setting name="restrict_to_types">organization</setting>
            <setting name="render">makeEditorLink</setting>
            <setting name="delimiter"><![CDATA[<br/><br/>]]></setting>
            <setting name="label" locale="en_US">Related Organizations</setting>
          </settings>
        </placement>

You'll notice that the "delimiter" setting employs a <![CDATA[]]> block. Without it, the installer would try to parse the tags it contains. This comes in handy when you're designing more complex templates, as discussed in Bundle Display Templates and seen in the example below:

<placement code="ca_occurrences.abstract">
          <bundle>ca_occurrences.abstract</bundle>
          <settings>
            <setting name="format">^project_abstract<![CDATA[<ifdef code="abstract_source"> <b>Source:</b> ^abstract_source</ifdef>]]></setting>
          </settings>
        </placement>

Please see Bundle Display Templates and displaying units for more on formatting display elements.

If you have multiple types in a given table and need to create different displays for each, you can use type restrictions as you would for a user interface:

<display code="photo_summary" type="ca_objects" system="1">
    <labels>
      <label locale="en_US">
        <name>Photo Summary</name>
      </label>
    </labels>
      <typeRestrictions>
        <restriction code="photo" type="photo"/>
      </typeRestrictions>

In which you wish to use the display only for type "photo" (and "photo" exactly matches the code in the object_types list).

Setting Description Values
show_empty_values If yes all values will be displayed, whether there is content for them or not. 1 (show empty) or 0 (don't show)

sphinx

Namespaces

Variants
Actions
Navigation
Tools
User
Personal tools