I am trying to display a checkbox field, with values of "Yes" if the checkbox is checked and "No" if it is not. When I set up the custom checkbox field, I specified that the value to show should be "Yes" if selected, and "No" if not selected.
I am attempting to display the field in a content template as a "Post Field", since that seems to be the only option that appears to actually give me the content of the checkbox field. The checkbox field in question is coming from the "one" side of a one-to-many relationship. The rest of the content in the template is coming from the "many" side. However, when I view the page, the output for the checkbox is 1 if checked, and it is blank if unchecked.
I am attaching screenshots of the custom checkbox field setup, as well as how I am referencing it in my content template. I am also attaching screenshots showing what is being output on the page for both checked and unchecked states.
What do I need to do to get this to display something other than 1 or nothing?
This is happening because you are using the views shortcode to get the value. What you need to use is the Types shortcode to get the value and it will return the texts.
Example.
[types field='new'][/types]
You can also pass the same ID into the shortcode as well.
Thank you for the response, Shane. I have actually tried that. In fact, that's what I initially attempted before using the "Post Field" method I sent you previously. If I change to using the types shortcode, I get a value of "No" regardless of whether the checkbox is checked or not. I think that this is due to the fact that when using the types shortcode, I'm unable to specify that the data should come from a post related to the current post. In other words, I think it's trying to pull the data from the current post, which is on the "many" side of the relationship. The desired field does not exist in the current post. Rather, the field needs to come from the "one" side of the relationship. But when I do the types shortcode, it does not give me the option to specify that the data should come from a related post. I'm attaching screenshots to hopefully illustrate the problem. Thanks!