Howdy, Stranger!

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

In this Discussion

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.

Pawtucket 2: sorting of related objects in detail pages

Hi! I’ve got a question concerning Pawtucket2: is it possible to set the sorting of related objects in detail pages to the title in alphabetic order instead IDs as it is now? Right now, when I’m on the detail page for an entity, the related objects (Verknüpfte Objekte) look like this (see that ID 1949 is before ID 3950 although the name of ID 1949 starts with several z’s):
image

In ca_entities_default_html.php in my Pawtucket theme there is this part of code which I assume pulls the related objects. would it be possible to change the sorting order and if so, where do I start? Thanks a lot for every input!

  {{{<ifcount code="ca_objects" min="1">
              <div class="row">
                  <div class='col-md-6 col-lg-6'><p><h5>Verknüpfte Objekte</h5></p><HR></div>
                  <div id="browseResultsContainer">
                  <?php print caBusyIndicatorIcon($this->request).' '.addslashes(_t('Loading...')); ?>
                      </div><!-- end browseResultsContainer -->
                  </div><!-- end row -->
                  <script type="text/javascript">
          jQuery(document).ready(function() {
              jQuery("#browseResultsContainer").load("<?php print caNavUrl($this->request, '', 'Search', 'objects', array('search' => 'entity_id:^ca_entities.entity_id'), array('dontURLEncodeParameters' => true)); ?>", function() {
                  jQuery('#browseResultsContainer').jscroll({
                      autoTrigger: true,
                      loadingHtml: '<?php print caBusyIndicatorIcon($this->request).' '.addslashes(_t('Loading...')); ?>',
                      padding: 20,
                      nextSelector: 'a.jscroll-next'
                  });
              });
          });
                  </script>
              </ifcount>}}}

Comments

  • edited June 2017
    As provided in the Gitter Chat, here the working solution:

    change 

    jQuery("#browseResultsContainer").load("<?php print caNavUrl($this->request, '', 'Search', 'objects', array('search' => 'entity_id:^ca_entities.entity_id'), array('dontURLEncodeParameters' => true)); ?>", function() {

    to this:

    jQuery("#browseResultsContainer").load("<?php print caNavUrl($this->request, '', 'Search', 'objects', array('search' => 'entity_id:^ca_entities.entity_id', 'sort' => 'ca_objects.preferred_labels.name'), array('dontURLEncodeParameters' => true)); ?>", function() {

    Note the 'sort' => 'ca_objects.preferred_labels.name' parameter

Sign In or Register to comment.