Skip Navigation

[Resolved] Show one image from repeating image gallery

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that user had a RFG view that would display the images of a Repeatable field group. However the user only wanted this view to display 1 item.

Solution:

This can be done by using the limit attribute for the view. Example.
[wpv-view name="available-space-image-gallery" limit="1"]

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 8 replies, has 2 voices.

Last updated by leilaG 6 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1104686

hidden link

Is it possible to show only one image from a repeating gallery image on the search results, so that all images are shown on the post page?

#1104744

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Leila,

Thank you for contacting our support forum.

When you are displaying the images using the [types field='image'][/field] you just need to use the index attribute. So if you want the field item then you would do [types field='image' index='0'][/field]

Please try this and let me know.

Thanks,
Shane

#1104884
one-image.PNG

I added the code - [types field='gallery-image' index='0'][/field]

But it didn't work, no images load (screenshot attached)

#1105488

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Leila,

Is this a repeatable field group or just an repeatable image field.

Could you send me a screenshot of the field on the backend ?

Thanks,
Shane

#1105510
repeatable-group.PNG

Repeatable group

#1105544

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Leila,

Not sure why a repeatable field group is used just for a single image. If you're going to just add other fields to the repeatable field group then thats fine.

However it will only have a single image field then I would recommend making the field itself repeatable. There should be an option on the image field that says "Allow for multiple instance.."

Thanks,
Shane

#1105548

Okay I'll try and explain.

Search and filter page (only this page/view we would like to display on the first image from the gallery of images - hidden link

Detailed page - where gallery of images are shown - hidden link

Does that make sense?

#1105588

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Leila,

Thank you for the clarity.

What I did was to just use the limit attribute and limited the view to only 1 output. [wpv-view name="available-space-image-gallery" limit="1"]

Thanks,
Shane

#1105656

PERFECT!! Just what we wanted. Thanks Shane