Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Checkbox Repeater Fields #2

Open
tanyabendis opened this issue Feb 28, 2022 · 7 comments
Open

Using Checkbox Repeater Fields #2

tanyabendis opened this issue Feb 28, 2022 · 7 comments

Comments

@tanyabendis
Copy link

Hi!
I am trying to use meta data from the repeater field (checkbox value) in order to show or hide the grid listing on the Single Post Page. I'll try to explain it in context so it makes more sense:
One my Single Post Page in Elementor for Custom Post Type: Schools, I have created a section called Weekly Schedule.
The Weekly Schedule is a repeater field that includes these subfields:
Name
Level
Start Time
Duration
Day of Week (Checkbox): Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.

I have created a listing item and with the grid listing I have shown these listing templates under the corresponding day of week. As you can see in my image, I was unable to hide the classes that were supposed to be only on Tue/Thu from the rest of the days of week since I cannot use Dynamic Visibility on Repeater Checkbox Fields either through just JetEngine or your additional plugin.

Screen Shot 2022-02-28 at 12 44 43

Let me know if I explained that well enough, if not, happy to share more information! Thank you so much!

@rtpHarry
Copy link
Owner

rtpHarry commented Mar 1, 2022

OK yes I understand the situation now, I will set something up on my test environment this evening and see what I can come up with.

@tanyabendis
Copy link
Author

Hi @rtpHarry - let me know how it is going? Or if I should come up with another solution. Thank you

@rtpHarry
Copy link
Owner

I've been looking into this today and I've put something together which will now work with checkbox fields.

Here is a proof of concept:

image

After a lot of experimenting, the way that I have done it is just a simple check. I have modified it so that if it detects an array of values, which the checkboxes is returned as, then it will attempt to turn it into a comma separated string:

image

This then lets the selected values be displayed in normal situations:

image

And also, that comma separated list is then understood by the dynamic visibility "contains" feature, so it now works.

For example, with a repeater checkbox like this:

image

Defined as mon, tues, wed:

image

You can set up a dynamic visibility "contains", and ignore the advice about jetengine checkbox fields in the text below it. Just select my "JetEngine Repeater Field" dynamic tag:

image

And set the value to point at the checkbox name:

image

As you can see for this one its set to the contains as "mon":

image

But you can also add comma separated values and "contains" will split them out and test each one, for example my mon or wed example:

image

So I'm going to release this now as v1.2.beta.1 and tag it as pre-release.

It seems like it will solve your immediate problem but I want to have a bit more of a think about this and how best to implement as it feels like a bit of a hack at the moment.

If I change the way I do things in the next release I'll let you know on this issue.

@rtpHarry
Copy link
Owner

OK its up at https://github.com/rtpHarry/jet-engine-repeater-values/releases/tag/v1.2.beta.1

@tanyabendis
Copy link
Author

Thank you! @rtpHarry this works great :D
Screen Shot 2022-03-26 at 17 12 51

One more question if you have a chance? Is it possible for it to work in front end forms using Jet Engine Forms:
It is not saving the checkbox values of the repeater key:
Screen Shot 2022-03-26 at 17 13 34

@rtpHarry
Copy link
Owner

rtpHarry commented Apr 7, 2022

I'm glad the changes got things moving forward!

I've not found any time to look into the follow up query yet. I've never used Jet Engine Forms in any my projects so it's been a big task to start experimenting with that and figure out how it saves its data and whatnot, so I just haven't found a spare block of time to look at this.

It sounds unrelated to my plugin though. This could be posted on the Crocoblock Facebook page to see if people with Jet Engines Forms experience know how to add repeater fields into the forms? Or even contacting Crocoblock directly in this case?

@rtpHarry rtpHarry changed the title Question / Request Using Checkbox Repeater Fields Apr 7, 2022
@pauserratgutierrez
Copy link

Hi @rtpHarry I need to show/hide images depending on the value of a checkbox. I can't figure a way to do it using your plugin. The checkbox is inside a repeater field.
image
Red -> repeater, Green -> checkbox

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants