Checkbox / Radio box question

7 months 2 weeks ago #316663 by AlanJones
Checkbox / Radio box question was created by AlanJones
Hello, I have a question that will hopefully be easy to answer.

On the site, community.discoverybaptist.org/ we have church membership. We have an admin that comes in and moderates a field we have set up, currently, it is a radio box, with yes or no.

The issue is, we want the label to display "Church Member" if they are one, and simply nothing at all if they are not. We have some users that are not apart of the church but use the site, and we do not want to embarrass them by putting "Not a member" or something like that.

I tried using a checkbox field to see if it would be set to "Yes" When checked and display nothing when unchecked but it displayed "No"

Let me know what I should do. Thanks!

Please Log in to join the conversation.

7 months 2 weeks ago #316665 by krileon
Replied by krileon on topic Checkbox / Radio box question
Easiest way is to just use the Layout features of a field. To use this edit your field in CB > Field Management and under Layouts use the following in Profile Value Layout for example.

[cb:if FIELD_NAME="1"][value][/cb:if]

Replace FIELD_NAME with the name of your field and replace the 1 with whatever the value is for "Church Member". This should cause it to display its value only if church member is selected otherwise it'll display the empty field value. Next you'd want to configure CB within CB > Configuration > User Profile to hide empty field values so the field doesn't show at all. You don't have to use [value] either, which will just output the value of your field; it can output whatever you like there.

Another option is to suppress a field based off value using CB Conditional. The below for example will hide the field entirely in profile view and userlist view, but not edit views, if it's a certain value.

Display: Field conditional show
Field: (select the fields self here)
Operator: Equal To
Value: 1
Locations
Registration: No
Profile Edit: No
Profile View: Yes
Userlists Search: No
Userlists View: Yes

Change the value to whatever the value is for your "Church Member" option is. This would cause the field to completely hide if they're not a church member for example.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 months 3 weeks ago #317045 by AlanJones
Replied by AlanJones on topic Checkbox / Radio box question
Hey! thanks a ton, this worked well. One more question.

Is there a way to have the field always show, (no matter the option checked) for super users? This would be so that we can manage the membership checkbox from the frontend rather than searching for users in the backend.

Please Log in to join the conversation.

6 months 2 weeks ago #317063 by krileon
Replied by krileon on topic Checkbox / Radio box question

Is there a way to have the field always show, (no matter the option checked) for super users? This would be so that we can manage the membership checkbox from the frontend rather than searching for users in the backend.

Yup, you should be able to use an elseif condition for that. Example as follows.

[cb:if FIELD_NAME="1"][value][cb:elseif user="#me" viewaccesslevel includes "6"][value][/cb:elseif][/cb:if]

The above should show the fields value to the user if FIELD_NAME is equal to 1 or if the viewing user has the view access level with an id of 6.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.400 seconds

Facebook Twitter LinkedIn