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

Checkbox field returns display value #57

Open
codente opened this issue Dec 20, 2017 · 5 comments
Open

Checkbox field returns display value #57

codente opened this issue Dec 20, 2017 · 5 comments

Comments

@codente
Copy link

codente commented Dec 20, 2017

So if I use either pods_display or use a magic tag and try to display a checkbox field value only if it is checked, I get output of "No" if unchecked.

So I've tried

[wpbb-if post:pods_template template='custom' custom_template='{@indie}'] [wpbb post:pods_template template='custom' custom_template='{@indie}'][/wpbb-if]

and

[wpbb-if post:pods_display field='indie'][wpbb post:pods_display field='indie'][/wpbb-if]

And a combination of these 2 as well and I always get "No" when unchecked.

@quasel
Copy link
Member

quasel commented Dec 20, 2017

I need to think about it

  • what should a user expect?
  • No means the value is set so I can't just always return 0/empty
  • hence wpbb-if would need a different behavior as wpbb

Workaround:
Use Pods shortcodes
[pods] [if indie] {@indie} [/if] [pods]

@quasel
Copy link
Member

quasel commented Dec 20, 2017

Note: Take a look at the ACF integration

@quasel quasel self-assigned this Dec 20, 2017
@quasel quasel added this to the Future Release milestone Dec 20, 2017
@quasel
Copy link
Member

quasel commented Jun 5, 2018

Revisiting this as part of 1.3 Release - still no idea what the best approach would be - the underlying issue is that pods stores values of 0 or 1 but Outputs the corresponding "Labels" per default that is Yes or No

Easiest Fix - Use custom "Label" in Pods Configuration -
image

i see no real way to change anything about that behavior besides just setting No to an empty string - ideas?

@codente
Copy link
Author

codente commented Jun 7, 2018

The problem with the custom label for me when I was testing this, is that it can't be blank. So if I don't want anything to appear if it's no, I don't see a way to do it? I change it to be empty (the no label), save, update the Pod and go back in and it still says No.

Well, I guess a hack is to just enter a space.

@quasel
Copy link
Member

quasel commented Jun 20, 2018

i think this can be closed as with Themer 1.2 there are more "conditonal" options out there and until then using my example for the [pods] and [if] shortcode should work? @codente

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

No branches or pull requests

2 participants