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.

Captions

Can anyone point me to right document/code to edit in order to get captions to appear with pictures on detail pages? In my case, I have a detail page for a historic district listed on the National Register of Historic Places with pictures of all the properties in the district. I'd like for the caption of each picture (denoting street address/description) to appear underneath the picture. 


Comments

  • Hi msjonesking,

    You can add an option to your detail.conf file to do this.  You might try something like this:

    representationViewerCaptionTemplate = <div class='small'>^ca_object_representations.preferred_labels.name</div>,
  • Hey Sophie, 

    Thanks, I see that in the detail.conf, and I un-commented it out. I guess now my question is how do I implement it into the detail php page? My sense is that it would go beneath {{{representationViewer}}}, but I'm not sure in what format. I realize that the below code isn't accurate, but that's my guess at least for placing it. 

    <div class='col-sm-6 col-md-6 col-lg-5 col-lg-offset-1'>
    {{{representationViewer}}}
    {{{representationViewerCaptionTemplate}}}

    <div id="detailAnnotations"></div>
    <?php print caObjectRepresentationThumbnails($this->request, $this->getVar("representation_id"), 
    $t_object, array("returnAs" => "bsCols", "linkTo" => "carousel", "bsColClasses" => "smallpadding col-sm-3 col-md-3 col-xs-4")); ?>
    <div id="detailTools">
    <div class="detailTool"><span class="glyphicon glyphicon-share-alt"></span>{{{shareLink}}}</div><!-- end detailTool -->
    </div><!-- end detailTools -->
    </div><!-- end col -->
  • You don't need to add anything in the detail page code - it's wrapped in the code for representationViewer.
  • edited April 2016
    That makes a lot of sense. I still don't see any captions though. I'm running an update to see if that helps. Is there anything else in my code/conf that might be preventing them from appearing? 


    UPDATE: Running an update from the develop branch didn't change anything. So I guess there must be something else in my configuration that's off for the caption function. 
    1247 x 566 - 682K
  • Hi msjonesking,

    Can you upload your detail.conf file please?  Or post the relevant (object) portion?
  • detailTypes = {
    objects = {
    displayName = _(Objects),
    table = ca_objects,
    restrictToTypes = [],
    options = {
    nextLink = <i class='fa fa-angle-right'></i><div class='small'>Next</div>,
    previousLink = <i class='fa fa-angle-left'></i><div class='small'>Prev</div>,
    resultsLink = <i class='fa fa-angle-double-left'></i><div class='small'>Back</div>,
    enableComments = 0,
    representationViewerPrimaryOnly = 0,
    representationViewerDontShowPlaceholder = 0,
    representationViewerCaptionTemplate = <div class='small'>^ca_object_representations.preferred_labels.name</div>,
    map_attribute = ca_objects.map,
    map_width = 100%,
    map_height = 200,
    # annotations
    # display annotations? Valid values are: viewer (in viewer), div (in external div with class #detailAnnotations), none (no display) [Default is none]
    displayAnnotations = div,
    # template used to format annotation in list; evaluated relative to the annotation
    displayAnnotationTemplate = ^ca_representation_annotations.preferred_labels.name (^ca_representation_annotations.duration%asTimecode=hms)
    },
    # --- aliases to this detail page - these map to browses that return this type of detail, only need to be defined if the key of this array differs from the browses that find this record type
    #aliases = []
    },
  • Do you have titles entered for your assets on the object representation record?  I believe this is set up to suppress the value [BLANK], which is the default value if no title is entered for an object representation.
  • I'll update my database and work on it. I've been checking it with objects for which I know the representation has a title, but there are definitely [BLANK] instances. 
  • So, I have an interesting development. When I use a different computer, sometimes I see the captions, but sometimes I don't. Sometimes when it takes the pictures a moment to load, I can see them and then the picture goes OVER the caption. Examples here: http://schpr.sc.gov/index.php/Detail/properties/23759http://schpr.sc.gov/index.php/Detail/properties/23740
  • Hi msjonesking,

    I wanted to let you know that this bug has been fixed on the develop branch of Pawtucket2 if you'd like to update!
  • Thanks! I'll definitely do that soon.

    On a somewhat related note, I'm having an interesting error with thumbnails. Any thoughts? 

    Errors occurred when trying to access/index.php/Detail/GetTimebasedRepresentationAnnotationList/detail_type/objects/object_id/26844/representation_id/:
    • Invalid input
    1603 x 843 - 978K
  • Are you using Representation Annotations in your site?  If not, you can simply remove that bit of code from the object detail page.
  • edited April 13
    Hello...I'm bringing this thread back to life temporarily. The info here was VERY helpful in getting captions to appear on my detail pages on primary images. But in cases where there are several representations and you click on a secondary image thumbnail, which in turn brings the new image in through an ajax call (or clicking through using the carousel nav arrows), the representationViewerCaptionTemplate is not called. Can somebody tell me where to plug this info?

    My environment (still in development) is Providence 1.7 and Pawtucket 2.

    Thanks! AJ
  • edited April 18
    Here's how I ended up solving the issue:

    I noticed in a browser inspector that the caption information I was missing for the representation was visible in the code, but the Carousel script wasn't leaving room for it when calculating the height necessary to display the new image information. So in the details.conf I put the caption info into it's own div based on the id number of the image:

    representationViewerCaptionTemplate = <div id='rep_pix^ca_object_representations.representation_id'><H6>^ca_object_representations.preferred_labels.name</H6><div class='caption'>^ca_object_representations.caption</div><div class='caption'>Photographer: ^ca_entities.preferred_labels.displayname</div></div>,

    Then in the bundles/detail_media_html.php file, I added the div to the height calculation inside script that calls jCarousel.js:
    // update carousel height with current slide height after ajax load
    jQuery(this).find('img').bind('load', function() {
    jQuery('.jcarousel').height($('#slide' + caSliderepresentation_ids[i] + ' #rep_pix' + current_rep_id + ' #slideContent' + current_rep_id + " img").height());
    });
    });
    } else {
    // update carousel height with current slide height
    $('.jcarousel').height($('#slide' + caSliderepresentation_ids[i] + ' #rep_pix' + current_rep_id + ' #slideContent' + current_rep_id + " img").height());
    }

    In the html of the page, you can see each of the captions for the items in the carousel as soon as any of the thumbnails is clicked:

    <div id="rep_pix7"><h6>This is a skier</h6><div class="caption">This is the caption of the skier photo</div><div class="caption">Photographer: AJ Hartley</div></div>
    image
Sign In or Register to comment.