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 Displaying repeating hierarchy bundles

We have a repeatable hierarchical value attached to one object type in our collection.  I'd like to have it display in Pawtucket2 like:

Parent1 > Child1 > Grandchild1
Parent2 > Child2 > Grandchild2

Instead, I get:
Parent1 > Child1 > Grandchild1 > Parent2 > Child2 > Grandchild2

My current display template looks like this:
{{{<ifdef code="ca_objects.materials"><H6>Materials:</H6></ifdef>
<unit delimiter="<br />"><unit>^ca_objects.materials.hierarchy.preferred_labels.name_plural%delimiter=_➞_</unit></unit>}}}

I've toyed around with a few other variations of nested units, but without success.

Comments

  • Try

    {{{<ifcount min="1" code="ca_objects.materials"><H6>Materials:</H6>
    <unit delimiter="<br />">^ca_objects.materials.hierarchy.preferred_labels.name_plural%delimiter=_➞_</unit></ifcount>}}}
  • Hi Sophie,
     That gives me the exact same results as my first attempt:

    Parent1 > Child1 > Grandchild1 > Parent2 > Child2 > Grandchild2
  • This works for me:

    {{{<ifcount min="1" code="ca_objects.materials"><H6>Materials:</H6>
                                        <unit relativeTo="ca_objects.materials" delimiter=" ➔ ">^ca_objects.materials.hierarchy.preferred_labels.name_plural</unit></ifcount>}}}

    (You can leave out the "ca_objects.materials" in the <unit> that is relative to ca_objects.materials, but I've left it in on the theory that it's clearer that way. Feel free to disagree :-)

    The key bit here is the "relativeTo". By setting it to ca_objects.materials you are forcing that unit to be evaluated for each repeat of that element. 
  • I'm sorry to say that I see no change in my output. Both hierarchies are listed together as one long string.

    Could it be that we have our hierarchical list set up in a way that is preventing this from working?


  • No idea. In my test environment your template gave similar results to what you report while mine works.
  • Today I downloaded fresh copies of Providence and Pawtucket 1.7.5, to try to start from scratch with the existing database, using the default themes. No change with the fresh sites. I also tried building a new test hierarchy to see if I could get that to display differently but that also didn't work.

    My site is using PHP 7.0.22. Is your test environment on 7 or 5.6?  ...grasping at straws here.
  • I was testing with PHP 7.1. Can you send me a copy of your database + your theme?
  • What is the preferred way to send that to you?
  • Send it by email or dropbox to seth@collectiveaccess.org
  • It turns out I need some local help exporting from our database server - but will have that for you early next week. Thanks!
  • I found the problem. Fixes for this are in GitHub/develop and will be included in the 1.7.6 release. 
  • I downloaded the develop branch of Pawtucket2 today to give it a try, and am still getting the same result of all values in a single string. I double-checked to make sure I had the branch with the latest update applied to app/lib/core/Search/SearchResult.php
  • Make sure you change your template to the one I specified. Here it is again:

       {{{<ifcount min="1" code="ca_objects.materials"><H6>Materials:</H6>
            <unit relativeTo="ca_objects.materials" delimiter="<br/>">^ca_objects.materials.hierarchy.preferred_labels.name_plural%delimiter=_➔_</unit></ifcount>}}}

  • Ahha, that works! This one is slightly different than the earlier one, with a delimiter in both the <unit> and in the object reference.
  • There was an irregularity with how hierarchal delimiters were being handled, and it was defaulting to a hardcoded value. That got fixed in this as well.
Sign In or Register to comment.