Skip Navigation

[Resolved] User photogallery with thickbox

This support ticket is created 5 years, 3 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 5 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1166194

I am trying to: create a photogallery for every user using multiple instance of image filed

Link to a page where the issue can be seen: hidden link

I expected to see: photogallery like this on this page hidden link
(I did it)

Instead, I got: usermeta image field didn't work like custom field image

#1166309

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I'm trying to understand the problem.

Visiting your link, it seems like it is a static page that you designed with Elementor where you inserted a View.

You say that the usermeta image field doesn't work, so does that mean that this View you have added is to display users, and that the users have an image custom field which you are trying to output in a gallery format.

Each user has one image and you are creating a gallery from different users, or each user has multiple instances of the image field, and you want to create a gallery of these images for each user?

#1166316

I need to create a gallery for each user.

#1166322

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

So the View on this page queries and loops over users, and users have an image custom field that can have multiple values, and the gallery should output each of these images, for each user.

I'm not sure how you were creating the galleries in your example that works, but if you have multiple values for the image field, then including the field (using the Fields and Views button) within the Loop Output section will output each of those images. Then it is just a question of ensuring you have the markup and classnames required to show the images in the format you want.

If I have some more details from you I may be able to help further.

#1166344

This page contain two view: first view load general data and the second view load photogallery.
I've used image custom field with multiple instance for each user.

The code looks like this:
[wpv-conditional if="( '[types usermeta='photogallery' output='raw' resize='proportional' separator=', '][/types]' ne '' )"]
<div class="row">
[wpv-for-each field="wpcf-photogallery"]
<div class="col-sm-4">
<a class="thickbox" rel="my-gallery" href="[types usermeta='photogallery' url='true'][/types]">
[types usermeta='photogallery' title='%%TITLE%%' alt='%%ALT%%' size='medium' resize='crop'][/types]
</a>
</div>
[/wpv-for-each]
</div>
[/wpv-conditional]

I've also tried this
[wpv-conditional if="( '[types usermeta='photogallery' output='raw' resize='proportional' separator=', '][/types]' ne '' )"]
<div class="row">
[wpv-for-each usermeta="photogallery"]
<div class="col-sm-4">
<a class="thickbox" rel="my-gallery" href="[types usermeta='photogallery' url='true'][/types]">
[types usermeta='photogallery' title='%%TITLE%%' alt='%%ALT%%' size='medium' resize='crop'][/types]
</a>
</div>
[/wpv-for-each]
</div>
[/wpv-conditional]

#1166400

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Checking the documentation for wpv-for-each it says "Iterate through multiple items in a post meta field".

According to that I'm not sure it is expected to work with user meta fields.

I've put in a question to the developers, and I'll update you.

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each

#1166426

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The developer confirmed that wpv-for-each can only be used with post fields, not user fields, hence why you have been unable to get it to work.

The multiple images will be output when you are not using the wpv-for-each shortcode, but you won't be able to construct links to wrap the images in.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.