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.

Summary problem : How to display a container with a subelement of type Entity

Hi.
I'm building a summary for object records on Provindence 1.6.3.
The problem is that I have a container with two subelements: one is a metadata of Entity type (not a relationship with an entity, but a field of type Entity), associated with another subelement of type text.
What I would like to do in the summary is to visualize the Entity name beside the text value hosted in the same container (I attach a screenshot of my container).

Example:
Entity: Entity 1 - Text: text1
Entity: Entity 2 - Text: text2

I tried a couple of different solutions, that I paste here below, but none of them worked to display the entity name:

<ifdef code="ca_objects.Container">
<unit relativeTo="ca_objects.Container" delimiter="<br>">
<ifdef code="ca_objects.Container.EntityField"><b>Entity</b>: ^ca_objects.Container.EntityField</ifdef>
<ifdef code="ca_objects.Container.TextField"><b>Text</b>: ^ca_objects.Container.TextField</ifdef><br>
</unit>
</ifdef>

or

<ifdef code="ca_objects.Container">
<unit relativeTo="ca_objects.Container" delimiter="<br>">
<ifdef code="ca_objects.Container.EntityField"><b>Entity</b>: ^ca_entities</ifdef>
<ifdef code="ca_objects.Container.TextField"><b>Text</b>: ^ca_objects.Container.TextField</ifdef><br>
</unit>
</ifdef>

Thanks for helping me out with this.

S

763 x 204 - 13K

Comments

  • Where are you including this display syntax? Is it within the display template setting of a bundle on a display? If so you don't need the unit, because it's already relative to that attribute. Also, ^ca_entities is not the correct code, because it's not drawing on the entity table but rather your entity attribute. It should be ca_objects.Container.EntityField. Finally, best practice is to include only the non-attribute text in the ifdef (end it after </b>)
  • Hi Julia,
    Thanks for your reply, but if I don't include the unit tag inside the bundle setting of the display view that I'm using for the summary, the view won't handle multiple containers.
    I tried it and it won't work.

    If I paste this: 
    <ifdef code="ca_objects.Container">
    <ifdef code="ca_objects.Container.EntityField"><b>Entity</b></ifdef>: ^ca_objects.Container.EntityField
    <ifdef code="ca_objects.Container.TextField"><b>Text</b></ifdef>: ^ca_objects.Container.TextField<br>
    </ifdef>

    The result is:

    Entity: Entity 1Entity 2Entity 3Entity4 - Text: text1text2text3text4

    Is there something that I'm missing?

    best,

    S
  • Thank you, Julia.
    I finally solved it by reincluding the <unit> tag to handle multiple containers.
    Moving the ifdef closing tag really did the trick. 

    So, for future reference, my syntax now is:

    <ifdef code="ca_objects.Container">
    <unit relativeTo="ca_objects.Container" delimiter="<br>">
    <ifdef code="ca_objects.Container.EntityField"><b>Entity</b></ifdef>: ^ca_objects.Container.EntityField
    <ifdef code="ca_objects.Container.TextField"><b>Text</b></ifdef>: ^ca_objects.Container.TextField
    </unit>
    </ifdef>
Sign In or Register to comment.