Skip Navigation

[Résolu] Display an Image Field with Multiple Instances

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.

This topic contains 3 réponses, has 2 voix.

Last updated by jamesH-3 Il y a 8 années.

Auteur
Publications
#167439

Hi

I have got three or four photos, uploaded by the users with a multiple instances image field.

How can I display one of them as a larger size photo and the other two as thumbnails?

hidden link

Thanks

#167479

Agnes Bury
Supporter

Languages: Anglais (English )

Timezone: Pacific/Midway (GMT-11:00)

Dear jamesH-3,

In this case, I would suggest you to store the "main" image (the one you'd like to display in a larger size) in a separate field.
Multiple instances are good for fields with the same "behavior".

Besides, separating the main image would pay off in another way: it would be easy to the user who will later insert the images, to remember the "special" purpose of that image.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

#167520

Agnes Bury
Supporter

Languages: Anglais (English )

Timezone: Pacific/Midway (GMT-11:00)

jamesH-3,
what I would add. There is a way to refer to a specific instance when using multiple instances fields. You could do this with index property, using Types Fields API:
https://toolset.com/documentation/functions/#tf-145214
Zero is for the first picture, 1 for the second and so on.

Yet, there is a bug (will be fixed in the next Types release): if there is only one image in your repeat field, the index does not work correctly. With more than one, the functionality works fine.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

#167926

Thanks Agnes.