Skip Navigation

[Resolved] Creating a gallery lightbox and open hours in View to load into Oxygen Builder

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Author
Posts
#1725395

I am building a directory site for wedding related businesses. I am creating listings for business owners to claim. They will have all their details eg, featured image, description, address anc contacts. And a lightbox gallery and opening hours. I am using Oxygen Builder. I have tried creating the single listing with toolset but I want to use Oxygen to create the single listing template.

I have started creating the Oxygen Single Listing template and importing dynamic data from custom post types I have created in Toolset. It's working better than I thought ( I have tried many directory listing plugins and Toolset looks the best).

Then I got to inserting the opening hours and the photo gallery fields that I have hit a snag. It would seem I have to create a view for each of them and insert them into the Oxygen template but I'm struggling to create these views.

I have looked at many videos and nothing seems to cover it specifically. I have the gallery in a right sidebar and I want to be a light box or a slider. I have know idea how to do the opening hours one.

My site is localhost. I'm sure there is more to ask so ask away and I will answer.

Thanks,
David

#1725867

Christian Cox
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Hello, if I understand correctly you have a custom field called "Gallery", it is an image custom field, and it allows for multiple instances. In other words, it is a repeating image field. Normally in Toolset you would use a Gallery block in the Block Editor to create a lightbox-style gallery for this image field (https://toolset.com/course-lesson/dynamic-galleries-and-sliders-for-templates-displaying-repeating-image-fields/). If you wanted to create a slider or lightbox interface using the Gallery field from multiple posts to display one image per post in a slider or lightbox, then you could use Views to loop over individual posts and include that single image from each post. Unfortunately it's not as straightforward to use Views to loop over the repeating images in a single post. That's what the Gallery block is for, specifically - to loop over a repeating image field in a single post and display all those images in a gallery. If that's what you're trying to accomplish in an Oxygen template, I would need to run some tests to see if it's possible. It might be possible to place a Toolset Gallery block in a Content Template, then insert that Content Template in your Oxygen design using a shortcode. However, I haven't tested that so I'm not sure if you can use a combination of templates this way. If this is what you're trying to achieve, please confirm and I will run some tests to see what we can do.

For the Opening Hours list, it sounds like you need to create a View of the Repeatable Field Group (RFG) and insert in the loop the fields you want to display for each row of the RFG. Then you'll need to add a Post Owner Query Filter to this View so that only RFGs for the current post are displayed in the results. Finally you would have to place that View in the Oxygen template for this post type to display the list of Opening Hours for each post. Is this enough information to get you started, or are you running into a specific problem implementing this View? I'll be glad to give more guidance if you let me know where you are stuck.

#1726505

Hello Christian,
Thank you for your reply. There may be some delays in my replies as I'm doing this in my spare time.
So I think I may have got the Gallery solved. Reading through your advise I realised I was on the right track. I had made a view and also made a Content Template separately. The Template wasn't quite right but once I added a gallery block to it things started coming together. Then I went back to Views and in the Loop Editor > Content Template button I selected the template I created the gallery in, and it worked. I then created a shortcode and inserted it into Oxygen with a shortcode module. However I can also insert the View in Oxygen by going to Add Module > WordPress > Dynamic Data > Toolset Views Module. I prefer doing it this way although either will probably do. See images attached.

I am running into problems overall implimenting the Opening Hours. I'll work on that next and let you know my results. Reply if you have more advise. As you can see in the screenshot "Nothing"

Thanks,
David

#1728305

Christian Cox
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

When you have time, please share the configurations of the View you are using to display Opening Hours here. Be sure to include the Query Filter settings so I can see the post relationship filter configurations.

#1733951

Hello Christian,
I have watched this Toolset video a few times...
hidden link
Tried to design my opening hours from it but it's still not working.

I have created Opening Hours (repeatable group) and inside that I have "Day of the Week", "Working Hours", "Open from" and "Closed at". See img 01, 02.
The "Working Hours" has x4 options. See img 03. The "Opening Times" option has a 1. I have set a condition in "Open" and "Closed" times where they are to be displayed if "Working Hours=1". See img 04. The "Open" and "Closed" are select option with time intervals at 30min.

In my View I have selected Opening Hours and set the query filter. See img 05. In the Loop Wizard I select unformatted style and the 4 fields. See img 06. The results of the Loop Wizard is img 07 and the grid I create is img 08.

In Oxygen I have added it using the shortcode and also with the Toolset Module. See img 09. Field is blank.

Do you think it might be something in the condition I set in the repeatable fields. I hope this is enough info for you to help me and steer me in the right direction.

Thanks,
David

#1734949

Christian Cox
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I don't think the conditional would cause the "No items found" message to appear. I assume you have added Opening Hours fields to at least one Business post. Where exactly are you displaying this View of Opening Hours - is it on the Single Post template for the parent Business? If so, uncheck the box "Don't include the current page in query result" at the top of your query filter screenshot, and test again. If that doesn't work, try adjusting the Query Filter selection to post ID set by a shortcode attribute wpvrelatedto. Then hard-code the post ID of the parent Business that has Opening Hours in the shortcode attribute as a test:

[wpv-view name="your-opening-hours-view" wpvrelatedto="12345"]

Replace your-opening-hours-view with the slug of your opening hours View, and replace 12345 with the numeric ID of the Business that contains opening hours fields.

Test that Business post again on the front-end of the site. If the hard-coded version works and some Opening Hours are displayed, we can try another shortcode to help the Query Filter find the parent Business ID more effectively. If no opening hours are displayed, I need to take a closer look and see what's going on.

#1745159

Hi Christian,
I tried the shortcode but it didn't seem to work. I think there is a bigger issue. I need to start over.

I have done some updates with WordPress and Toolset and it all seems different now. I'm struggling to learn all this. I'll have to go back to the basics and start again. I think you can close this issue so I don't waste any more of your time. Thank you for trying to help.

David

#1745509

Christian Cox
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Sorry to hear that recent updates are frustrating and blocking your progress. Please, do feel free to open new tickets when you need assistance. Hopefully the support team can get you on track quickly and smooth out the process. I'm closing here per your comments.