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.

Advanced Search Results - Additional field to display - browse_results_list_html.php

edited April 15 in Pawtucket

Hello,

We have the following default configuration in the browse_results_list_html.php file to display the advanced search result details for the objects.

$t_list_item = new ca_list_items();
while($qr_res->nextHit() && ($vn_c < $vn_hits_per_block)) {
$vn_id = $qr_res->get("{$vs_table}.{$vs_pk}");
$vs_idno_detail_link = caDetailLink($this->request, $qr_res->get("{$vs_table}.idno"), '', $vs_table, $vn_id);
$vs_label_detail_link = caDetailLink($this->request, $qr_res->get("{$vs_table}.preferred_labels"), '', $vs_table, $vn_id);

In DIV, the below code exists to display it.

                {$vs_idno_detail_link}{$vs_label_detail_link}

Now, I would like to add some extra information into the advanced search results. We would like to display the value "ca_entities.preferred_labels.displayname" also in the object search results and it works fine in the normal search results but not sure how to implement this in the Advanced Search results.

"
<?php print $qr_results->getWithTemplate(' unit relativeTo="ca_entities" restrictToRelationshipTypes="creator,after_artist,Collaborating_Artist,attributed_to" delimiter=", " ^ca_entities.preferred_labels.displayname /unit', array('returnAsLink' => true, 'checkAccess' => $va_access_values)); ?>

"

I tried the below code for the Advanced search results (browse_results_list_html.php file) but it didn't work. Could you please help?

$vs_label_detail_link_new = caDetailLink($this->request, $qr_res->get("{$vs_table}.ca_entities.preferred_labels.displayname"), '', $vs_table, $vn_id);

In DIV, tried the below code to display it but didn't work.

{$vs_idno_detail_link}
{$vs_label_detail_link}
{$vs_label_detail_link_new}

Comments

  • @seth @Julia
    Can you help with this please?
    How would I display the "ca_entities.preferred_labels.displayname" in the advanced search result details for the objects?

    The following works fine in normal Search results but the advanced search page (browse_results_list_html.php file) is coded differently. Any help would be much appreciated.

    unit relativeTo="ca_entities" restrictToRelationshipTypes="creator,after_artist,Collaborating_Artist,attributed_to" delimiter=", " ^ca_entities.preferred_labels.displayname

  • edited April 29

    The following lines of code worked for me. Thanks for your help...

    $vs_label_detail_link_en = $qr_res->getWithTemplate('^ca_entities.preferred_labels.displayname');

Sign In or Register to comment.