Skip to Content Skip to Menu

[SOLVED] Can I do this with CB Conditionals (or, somehow?)

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
8 years 4 weeks ago - 8 years 4 weeks ago #287354 by krileon
Set each field to profile edit display to "Yes, 2 Lines with Title" then in the CSS Class parameter add myFieldRows class. Next use the following CSS.
Code:
.myFieldRows { width: 30%; display: inline-block; vertical-align: top; } .myFieldRows + .myFieldRows + .myFieldRows + .myFieldRows > .control-label { display: none; }

That will cause each field to display side by side with a 30% width so you'll get 3 fields per row. The second part of the CSS hides the titles of all the other rows except for the first row. You can get rid of the second chunk of CSS if you set your the 4th field and onward to display in profile edit as "Yes, 1 Line without Title".


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.
Last edit: 8 years 4 weeks ago by krileon.
The following user(s) said Thank You: Paladin Brewer

Please Log in or Create an account to join the conversation.

8 years 4 weeks ago #287380 by Paladin Brewer
Replied by Paladin Brewer on topic Can I do this with CB Conditionals (or, somehow?)
Hey thanks, that worked great. I did have to put on a "!important" to get it to work, but that happens.

Now my next question is with the conditionals. I can't seem to get those to work, they don't work how I thought they did.
First I tried setting my cb_alt_two_name to only Show if cb_alt_one_name is "not empty", and then another conditional if cb_alt_one_race is "not empty", and also another if cb_alt_one_class is "not empty." However setting all 3 of these conditionals seems to do nothing, it will Show if only 1 condition is being met.


So I tried to set conditionals on the cb_alt_one_name/race/class instead, like this:


Same problem though, setting a conditional for each field is irrelevant, it will show with 1 condition is met. So how do I get my second row of fields to only show if all 3 of the above fields are "not empty"?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
8 years 4 weeks ago #287400 by krileon
Conditions can chain assuming you left resetting default enabled within CB > Plugin Management > CB Conditional > Parameters. So you'd set this up by having alt_two fields check if an alt_one field has a value. Next alt_three would check if alt_two field has a value. Based off your field setup I'd just condition against the name field. The alternative is to have a dropdown select field to select how many alts they have then condition off that.

Note a field can not be conditioned more than once. At this time there is no AND/OR usage so multiple conditions on the same field will just conflict with one another.


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 or Create an account to join the conversation.

8 years 4 weeks ago #287404 by Paladin Brewer
Replied by Paladin Brewer on topic Can I do this with CB Conditionals (or, somehow?)
Resetting is enabled.

I'm not too sure what you are saying. It sounds like you want the alt_two_name field and alt_two_class field, for example, to check for alt_one_name EMPTY/NOT EMPTY. But does that guarantee all 3 fields won't show?

Basically what I want is, the alt_two_name, alt_two_race, alt_two_class....I don't want any of those fields showing unless all 3 of alt_one_x fields are all filled in. I might have to go with the drop down like you said, I was trying to avoid that though if possible :) I still don't understand why fields show 5 conditional choices if you can only use one.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
8 years 4 weeks ago #287406 by krileon

I don't want any of those fields showing unless all 3 of alt_one_x fields are all filled in.

You won't be able to do that as said above there is no AND/OR usage for conditions and a field can only be conditioned once. You need to pick 1 of those 3 to condition against or use a simple dropdown to select how many alts they want and condition off that.

I still don't understand why fields show 5 conditional choices if you can only use one.

For the "Conditional Others" usage, which eventually will be removed when the AND/OR usage is added.


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 or Create an account to join the conversation.

8 years 3 weeks ago #287429 by Paladin Brewer
Replied by Paladin Brewer on topic Can I do this with CB Conditionals (or, somehow?)
Well I got the dropbox to work fine, that will do :)

Just one other question I think, how do I get the fields to show the label? I've been trying [cb:userdata field="cb_alt_one_class" formatting="div" /] and [cb:userdata field="cb_alt_one_class" formatting="divs" /] and didn't work, then I tried span and such and also not working. I hope we can get fields to show labels? :)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum