Skip Navigation

[Resolved] Adding a checkbox to image gallery

This support ticket is created 4 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1342327
mockup _Admin Select Discovery Images-page-002.jpg
mockup _Admin Select Discovery Images-page-001.jpg

Hello,

I am writing on behalf of my client Kenneth Reed.

I am trying to add the checkbox field to an image gallery so I can check/select the image I want to use later in listings, but with no success. Is it doable?
The image gallery is in Attraction CPT.

Also, I wonder how to build 2 admin pages (in the WP dashboard) so I can select/filter the images from the CPTs? (mockups are in the attachment).

Thanks,
Strahinja

hidden link

#1342359

Hello, Toolset doesn't really help you create new pages in wp-admin like this. I can show you how to use Forms on the front-end of the site to edit or create posts, or to establish post relationships between two posts. Forms works on one post or one pair of posts at a time, not multiple posts. So a table with rows of edits like this isn't possible.
Page 1 looks like a custom search View. I'm not sure how Continent Country Region and Destination are set up on this site. Are they custom fields, or taxonomies, or something else?

#1342549

Hello Christian,

thank you for your answer.

It is a shame that Admin pages can't be made in Toolset. Can you suggest some other solutions and how I can accomplish it using Toolset?
Continent, Country, Region, Destination, Attractions are CPTs in relationships one-to-many (One continent has multiply countries but one country has only one continent ... etc.)

Can you answer the first question? How to add a checkbox to an image in image gallery? The image gallery was built using repeater fields.

I can give you admin credentials to look from inside, so if you can make this post private.

Thanks

#1342903

Okay please provide login credentials in the private reply fields here and I will take a look.

#1344553

How to add a checkbox to an image in image gallery? The image gallery was built using repeater fields.
There's no way to add a checkbox to each instance of a repeating image field. You could create a repeatable field group (RFG) if you want to have a checkbox or other custom fields associated with each item, but I'm not sure how that would work with your gallery on the front-end. Some galleries are made with repeating image fields, and not designed to work with RFGs.

#1347525
Image gallery - RGF.jpg

Hi Christian,

thank you for your assistance and idea about RFG. I made it (see the attachment).

Now, I need assistance for displaying these images (filter by checkboxes) as a listing.
For instance: hidden link scroll down and find "Discover" section, this listing is set by a View (Testing Discover on Region template). Items in this listing are related to the region (Paris & Northwestern France) and it should be displayed with images we choose from the Image gallery (with checkboxes).

Thank you in advance

#1347655
val-to-store.png
qf.png

Okay so let me make sure I understand. You have these "Attraction" posts. Each Attraction post has a RFG of images. On the Attraction post page, you would like to display a grid of images. For example, all the Home Discovery images, or all the Continent Discovery images. Is that correct?

If that is correct, then I assume you have created an Attraction post template. Next, follow these steps:
- Create a View of the Image Gallery RFG
- Add a Post Relationship Query Filter. If you cannot find the Query Filter editor, scroll to the top right corner of the View editor and click "Screen Options". You can turn on the Query Filter editor here.
- The Query Filter should be set to "select items in the RFG group that are related to the post where this View is shown". See qf.png for an example. In this example, my RFG is called "book rfg group" but yours will be something else related to image gallery.
- Add another Query Filter, and this time select one of the checkbox custom fields, like "Home Discovery". Configure it to test that the checkbox field is equal to 1. This is the normal setting unless you chose something else when creating the checkbox field, see val-to-store.png. The Query Filter should be equal to the "Value to Store" from your checkbox field.
- Use the Loop Wizard to create a Bootstrap Grid, and insert the custom field image in the loop.

Insert this View in the template for the Attraction post. Let me know if you get stuck.

#1352247
Image 04.jpg
Image 03.jpg
Image 02.jpg
Image 01.jpg

Hi Christian, thanks for your help, but I don't get any result.

I guess we have don't understand each other very well, so I will try to explain better this time.

I've got 5 CPTs ( Continent -> Country ->Region -> Destination -> Attraction ) in relationships one-to-many. All the data are in Attractions CPT. I need to display related posts in, for instance, Region page (see Image 03). I've built Image gallery as RFG with image and checkboxes, I want to display images only with Region Discovery checkbox checked. (see Image 04).

You can see the View I've used (see Image 02) and settings for the checkbox field (see Image 01).

Thanks

#1353209

Shane
Supporter

Languages: English (English )

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

Hi Kenneth,

Not sure how you will want to display the images on a Region CPT when Region doesn't have any images.

Is it that you want to display the images of the respective Attractions where the destination is related to the Region ?

Please let me know as this will involve multiple views to display exactly what you want.

Thanks,
Shane

#1353709

Hi Shane,

Yes, that's right. I want to display the images of respective Attractions (checked by the checkbox) where the Destination is related to the Region.

The same will go for the level up (display the respective images of Attraction checked by the checkbox where the Destination is related to Region who is related to Country).

In the end, the same will go for the Continent (images from Attraction who is related to Destination, who is related to Region, who is related to Country).

It looks rather complicated, but the idea is as follows: when you select the Continent (Europe for example) I want to display all the respective Attractions (images in this case) who are related to Continent (Eiffel Tower, Coliseum, London Bridge for example). The same will go respectively for Country, Region or Destination.

Thanks

#1354397

Shane
Supporter

Languages: English (English )

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

Hi Kenneth,

In order to display the images on the region you will need to create a child view that will list out the regions destination based on the currently viewed region.

Then you will need to create another view for attractions and add a relationship filter to the Attractions view, then add this view to the Destinations view.

This is how you will be able to see the images that are associated with a region.

Would you like for me to setup an example for you so you can see this working ? Or are you familiar with setting this up.

Thanks,
Shane

#1355429

Thanks Shane,

I will need assistance with this. Can you use a View called "Testing Discover on Region Template" which is inserted in the Regions template built with Elementor. This way we will be able to see the changes in the Discover section right away hidden link (scroll down to the bottom of the page). In the previous messages, I've sent my login credentials.

#1357231

Shane
Supporter

Languages: English (English )

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

Hi Kenneth,

I've set this up for you now.

You can see the example here : hidden link

Here are the views that i used.

Parent: hidden link
- This view filters for the Destinations based on the current region.

Child : hidden link
- This view filters for the attractions based on the Destinations that the view in the Parent is listing out.

Grandchild: hidden link
- This view filters for the images of the Attractions that were being listed out by the Attractions child view.

If you trace through each view you can get an understanding of how this setup works.

Thanks,
Shane

#1359257

Thank you, Shane,

this is very helpful, I just need a couple of days to test/edit the setup you created to modify for other relations (grand grandchild, etc.)

Don't close this thread, If I need some more clarification.

Thank you again.

#1359267

Shane
Supporter

Languages: English (English )

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

Hi Kenneth,

Happy I was able to assist you with this one.

Please update me when you get the chance.

Thanks,
Shane

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