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.

Pawtucket2 Default Theme Show "Related Objects" when viewing Object on Details View

Has anyone had experience with variables used for pulling related objects?

I would like to have the object<>object relationship display similar to how related entities do:

{{{<ifcount code="ca_entities" min="1" max="1"><H6>Related entity</H6></ifcount>}}}
{{{<ifcount code="ca_entities" min="2"><H6>Related entities</H6></ifcount>}}}
{{{<unit relativeTo="ca_entities" delimiter="<br/>"><l>^ca_entities.preferred_labels.displayname</l></unit>}}}
However, when I try the following, the result is poor because the object in the variable refers to the currently displaying object :/

{{{<ifcount code="ca_objects" min="1" max="1"><H6>Related object</H6></ifcount>}}}
{{{<ifcount code="ca_objects" min="2"><H6>Related objects</H6></ifcount>}}}
{{{<unit relativeTo="ca_objects" delimiter="<br/>"><l>^ca_objects.preferred_labels.name</l></unit>}}}

How can I access related objects in this manner?

Is there a ca_objects.related_objects.name variable or similar?

Thank you!

Comments

  • I adjusted the code to read:

    {{{<ifcount code="ca_objects.related" min="1" max="1"><H6>Related object</H6></ifcount>}}}
    {{{<ifcount code="ca_objects.related" min="2"><H6>Related objects</H6></ifcount>}}}
    {{{<unit relativeTo="ca_objects.related" delimiter="<br/>"><l>^ca_objects.related.preferred_labels.name</l></unit>}}}

    It achieves displaying the labels of the related objects, however all of the rows of items are rendering as one single link with the labels concatenated. 
  • I believe that you need:
    {{{<unit relativeTo="ca_objects.related" delimiter="<br/>"><l>^ca_objects.preferred_labels.name</l></unit>}}}

    the <unit> tag shifts the focus over to the related objects. You could even remove the leading ca_objects and simply have:

    {{{<unit relativeTo="ca_objects.related" delimiter="<br/>"><l>^preferred_labels.name</l></unit>}}}

    Which I find makes more sense to me as it then assures me that I'm only dealing with records from the current unit.
  • This works perfectly:

    {{{<ifcount code="ca_objects.related" min="1" max="1"><H6>Related object</H6></ifcount>}}}
    {{{<ifcount code="ca_objects.related" min="2"><H6>Related objects</H6></ifcount>}}}
    {{{<unit relativeTo="ca_objects.related" delimiter="<br/>"><l>^ca_objects.preferred_labels.name</l></unit>}}}
Sign In or Register to comment.