I need to change labels in a dropdown list according to the member’s gender.
I have created a field for member’s gender. I understood how i can use it conditionnaly on the parameters tab of my target field.
This tutorial
made it very clear. I also read
this
.
However I don’t understand how to use the "if" test to substitute specifically some labels of my dropdown list.
I’m sure my use case is quite common for languages like French. My dropdown is for the member’s occupation. I simply need the occupation to show in its masculine/feminine form according to the person’s gender. What’s the best way to achieve this ?
Once you've your select field with the values you want you need to add your substitutions to its profile value layout found by editing the field in CB > Field Management then under Parameters > Layouts. Below is an example of a substitution usage to adjust the display based off the fields value. For the purpose of an example i'll use "male" and "female" values and name the field "cb_gender".
[cb:if cb_gender="male"]I am Male[/cb:if]
[cb:if cb_gender="female"]I am Female[/cb:if]
What text you supply is entirely up to you. You can even use HTML if you like. So for example if I wanted an image instead I'd use the below.
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.