Forum

Thread tagged as: Gallery

Gallery Images - Displaying Additional Fields on Front End for image.html

The gallery documentation details that we can add additional fields to Gallery master template for images (image.html) - these appear in the admin area for the uploaded images without issue. I am puzzled however - how do we display the data of these fields on the front end? Is that possible?

I add the following inimage.html:

<perch:gallery id="test" type="text" label="Test" />

And use the following to display the field's content - but it shows nothing

<perch:gallery id="test" />
Dan Lee

Dan Lee 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Where are you using it?

Dan Lee

Dan Lee 1 points

I was using it in the template that lists out the images. a_list_image.html

<perch:before>
    <hr/>
    <h5><perch:gallery id="albumTitle" /></h5>
        <ul class="clearing-thumbs gallery" data-clearing>
</perch:before>

            <li>
                <a class="gallery-hover" href="<perch:gallery id="large" />">
                    <img 
                    data-caption="<perch:gallery id="imageAlt" />" 
                    src="<perch:gallery id="xsmall" />" 
                    width="<perch:gallery id="xsmall-w" />" 
                    height="<perch:gallery id="xsmall-h" />" 
                    alt="<perch:gallery id="imageAlt" />" 
                    />
                </a>
                        <perch:gallery id="test" />
            </li>

<perch:after>
        </ul>
</perch:after>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that should work. What does <perch:showall /> output?

Dan Lee

Dan Lee 1 points

It shows the following:

ID  Value
url_0   /feed/post/2015-02-09-hello-world
url_s   2015-02-09-hello-world
url_1   2015-02-09-hello-world
feed_page   true
perch_page_path /feed/post
current_category    false
description 
albumID 3
albumTitle  Flowers
albumSlug   flowers
albumOrder  2
albumDynamicFields  {"description":{"raw":"","processed":""}}
filesize_min    0
filesize_max    0
camera_manufacturers    
camera_models   
orientations    
taken_at_min    1999-11-30 00:00:00
taken_at_max    2015-08-19 12:29:00
resolution_xs   
resolution_ys   
resolution_units    
exposure_times  
f_numbers   
focal_lengths   
color_spaces    
pixel_x_dimension_min   0
pixel_x_dimension_max   0
pixel_y_dimension_min   0
pixel_y_dimension_max   0
gps_longitudes  
gps_latitudes   
perch_description   
imageID 22
imageAlt    img_026
imageSlug   img026
imageOrder  1
imageDynamicFields  
imageStatus active
imageBucket default
filesize    4463821
camera_manufacturer FUJIFILM
camera_model    X10
orientation 1
taken_at    2011-10-13 11:19:21
resolution_x    72/1
resolution_y    72/1
resolution_unit 2
exposure_time   10/1600
f_number    280/100
focal_length    710/100
color_space 1
pixel_x_dimension   4000
pixel_y_dimension   3000
gps_longitude   N/A
gps_latitude    N/A
admin_preview   /login/resources/img_026-w180.jpg
admin_preview-w 180
admin_preview-h 135
admin_preview-id    198
admin_preview-key   admin_preview
admin_thumb /login/resources/img_026-w80h80.jpg
admin_thumb-w   80
admin_thumb-h   80
admin_thumb-id  197
admin_thumb-key admin_thumb
original    /login/resources/img_026.jpg
original-w  4000
original-h  3000
original-id 196
original-key    original
thumb   /login/resources/img_026-w30h30.jpg
thumb-w 30
thumb-h 30
thumb-id    195
thumb-key   thumb
xsmall  /login/resources/img_026-w145h82.jpg
xsmall-w    109
xsmall-h    82
xsmall-id   194
xsmall-key  xsmall
vsmall  /login/resources/img_026-w200h113.jpg
vsmall-w    150
vsmall-h    113
vsmall-id   193
vsmall-key  vsmall
small   /login/resources/img_026-w360h203.jpg
small-w 360
small-h 203
small-id    192
small-key   small
main    /login/resources/img_026-w640h360.jpg
main-w  480
main-h  360
main-id 191
main-key    main
large   /login/resources/img_026-w960h540.jpg
large-w 720
large-h 540
large-id    190
large-key   large
_id 22
perch_item_first    true
perch_item_zero_index   0
perch_item_index    1
perch_item_rev_index    4
perch_item_rev_zero_index   3
perch_item_odd  
perch_item_count    4
perch_namespace perch:gallery
Drew McLellan

Drew McLellan 2638 points
Perch Support

Curious that imageDynamicFields is empty.

When you edit your field, does the content repopulate correctly?

Dan Lee

Dan Lee 1 points

No. When I update the field, save and browse out and then go back in to edit the image - the field is empty.

This might be related to some customisation we have had done to the Gallery App. I'll have to check.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. If you've edited the app we can't really offer you any support for it.

Dan Lee

Dan Lee 1 points

Thanks for you help anyway. :)