Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.

If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping

Answers may be delayed for posts that do not include sufficient information.

Display template for relationship: Configure at central location?

I have a display template for an "object<>entity" relationship.

Currently I need to copy/paste this template text to every UI where this relationship element is used.
This also means that I need to administer/update/fix the same template in all these different locations...

Is there a way that I can define a display template for this type of relationship somewhere in a central location?

Thank you very much in advance! :smile:


  • edited October 13

    I think I've found it:
    In "conf/app.conf" around line #1471:

    # -----------------------------------
    # Default display templates for related bundles (Eg. ca_entities, ca_occurrences, etc.) ** in user interfaces **
    # -----------------------------------

    Works as expected!
    Case closed.

  • I couldn't make it work, could you share an example of what you did?
  • @mbutel:
    Sure! :smiley:

    Here's the whole block copied from my app/conf/app.conf:

    # -----------------------------------
    # Default display templates for related bundles (Eg. ca_entities, ca_occurrences, etc.) ** in user interfaces **
    # -----------------------------------
    ca_objects_default_editor_display_template = <ifdef code=''><l>^</l></ifdef>
    ca_entities_default_editor_display_template = <b>Name:</b><ifdef code='ca_entities.preferred_labels.displayname'><l>^ca_entities.preferred_labels.displayname</l></ifdef><br/><ifdef code="ca_objects_x_entities.cws_HasAgent.cws_Activity"> <b>Activity:</b> <unit delimiter="," aggregateUnique=1 sort="^ca_objects_x_entities.cws_HasAgent.cws_Activity"> ^ca_objects_x_entities.cws_HasAgent.cws_Activity </unit> <ifdef code="ca_objects_x_entities.cws_HasAgent.cws_Character"> <br/> <b>Character(s):</b> <unit delimiter="," aggregateUnique=1> ^ca_objects_x_entities.cws_HasAgent.cws_Character </unit> </ifdef> </ifdef> <br/>
    ca_places_default_editor_display_template = <l>^</l>
    ca_occurrences_default_editor_display_template = <l>^</l>
    ca_object_lots_default_editor_display_template = <l>^</l>
    ca_storage_locations_default_editor_display_template = <l>^</l>
    ca_loans_default_editor_display_template = <l>^</l>
    ca_movements_default_editor_display_template = <l>^</l>
    ca_list_items_default_editor_display_template = <l>^ca_list_items.preferred_labels.name_plural</l>
    ca_object_representations_default_editor_display_template = "Format: ^ca_object_representations.media_format<br/>
    Filesize: ^ca_object_representations.media_filesize<br/>
    <ifdef code='ca_object_representations.media_colorspace'>Colorspace: ^ca_object_representations.media_bitdepth ^ca_object_representations.media_colorspace<br/></ifdef>
    <ifdef code='ca_object_representations.original_filename'>File name: ^ca_object_representations.original_filename<br/></ifdef>
    <ifdef code='ca_object_representations.page_count'>Pages: ^ca_object_representations.page_count<br/></ifdef>
    Access: ^ca_object_representations.access<br/>
    Status: ^ca_object_representations.status<br/>"

    The only line I've modified is the one with "ca_entities_default_editor_display_template". The rest is CA's default (version git branch develop).

    Unfortunately this config requires everything to be in a single line, so I had to remove all linebreaks.
    I designed the display template in an external textfile (with linebreaks, for readability) - then copy/pasted it here - and removed the linebreaks.

    Good luck!

  • Thank you!
Sign In or Register to comment.