Skip Navigation

[Resolved] View block with a dynamic Gallery doesn't show correct images

This support ticket is created 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 3 voices.

Last updated by predragO 2 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2619909
Untitled-1.jpg

I'm creating a directory platform with various listings, with Toolset and Elementor. Listings have images and the users can add up to 20 images. Content template is made in Elementor and I use dynamic Toolset elements.

I made a View Block with a gallery that uses dynamic source from the listings since I want to add the view into Elementors' template. However, the images aren't displayed correctly, they are all mixed from various listings. Even when I'm editing a view, and choose dynamic source from the Current Post and correct field, I'm seeing images from different posts.

When I add the View block in Elementor's page template, I'm actually seeing all the other galleries, except the one that should be visible (see attached image).

What might be the problem? I noticed this problem just when I added more listings.

Thanks

#2619941

Nigel
Supporter

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

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

Hi there

Can I clarify your set up?

You have a listings post type, and listings include an image field you can add multiple images to.

The Toolset gallery block can create galleries of those images.

I imagine that when displaying one listing you want to display the gallery that corresponds to that listing.

It sounds like you are using a View block added to the Elementor template for listings to display galleries, but the View block would query all the listing posts and output the gallery for every listing, which doesn't sound like what you would want.

You would want to just display the gallery for the listing being shown.

So you would not use a View at all.

You can't add a Toolset gallery block directly to an Elementor template.

What you can do instead is create a Toolset template (don't assign it to the listing post type if you already have an Elementor template for listings) and add the gallery block to that template.

Then insert the Toolset template into the Elementor template. To do that you'll need to add it as a shortcode to a text module.

The shortcode will look like this:

[wpv-post-body view_template="your-template-slug" suppress_filters="true"]
#2619945
Screenshot at Jun 29 13-39-24.png

Thanks Nigel,

Your clarification is correct, but I still don't understand why View block with dynamically assigned images won't work?

I successfully implemented the right images with your shortcode and guidance, however, they are not showing up as they are set in the Content template I created, ie. the layout is not showing correctly.

Do you have any idea what might be causing that? It's just showing images in a row, ignoring the layout i set (see image).

Also, is there a way to only show exact number of images in that Gallery block. I want to display only 5 images in that section, I don't want the whole gallery to be shown as my layout then doesn't have a point. The layout should look like on the example image I sent in previous message (that's how i set it in the Gallery block in Content template).

Hope you can help with these problems!

#2619963

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What Nigel said is true that its not required to use view block to display current post information as view will loop through all the posts.

I'm not sure why you dont able to see the same layout. Can you please share problem URL and admin access details and let me see whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2619971

Hi,

I figured it out. The second part of the shortcode was blocking the desired layout. I removed "suppress_filters="true"" part and it looks good now.

Thank you!

#2619973

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok great - glad to here that solution share by Nigel help you to resolve your issue.

#2619985

My issue is resolved now. Thank you!

#2620211

Hi,

I realized I didn't get a solution on a second question.

Is there a way to only show exact number of images in that Gallery block. I want to display only 5 images in that section, I don't want the whole gallery to be shown as my layout then doesn't have a point. The layout should look like on the example image I sent in previous message (that's how i set it in the Gallery block in Content template).

Is there a way to make this layout?