Skip to Content Skip to Menu

CB Conditonal Fields?

10 years 3 weeks ago #250779 by zingerdigital
CB Conditonal Fields? was created by zingerdigital
In CB 1.9.1, I was checking the [gid] field with CB Conditional.

Since upgrading to CB 2.0, it doesn't seem to be able to check that field anymore.

Can I still use [gid] to find the Group ID, or is there another field I can check to find out the profile user's Group ID / Access Level???

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48480
  • Thanks: 8283
  • Karma: 1443
10 years 3 weeks ago #250789 by krileon
Replied by krileon on topic CB Conditonal Fields?
[gid] Doesn't exist anymore. It can't, there's no way to populate it. Joomla 2.5 and never support multiple usergroups so it's impossible to determine which of those usergroups should be the top most usergroup. CB Conditional upgrade will receive a new condition specifically for testing usergroups and viewaccesslevels, but for now there's not a very ideal way of doing it. You could try the below though.

Value:[cb:if gids includes "2"]1[/cb:if]
Operator: Equal To
Value: 1

The idea is to test if the usergroup 2 (registered) is in the users gids. If it is it outputs 1, which it compares against (otherwise would be empty and condition would fail).


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.

10 years 3 weeks ago #250795 by zingerdigital
Replied by zingerdigital on topic CB Conditonal Fields?
I was able to get it to work with the value [gids]

[gids] display the group id for the profile user. So I can just check against that

Thanks
Robert

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48480
  • Thanks: 8283
  • Karma: 1443
10 years 3 weeks ago #250797 by krileon
Replied by krileon on topic CB Conditonal Fields?
[gids] can end up being an array. I don't suggest relying on that. If it implodes it'd be #|*|#|*|#, but if it doesn't it'd be a raw array, which likely won't condition well.


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.

10 years 3 weeks ago #250800 by zingerdigital
Replied by zingerdigital on topic CB Conditonal Fields?
So you think it's better to use this example.....

Value:[cb:if gids includes "2"]1[/cb:if]
Operator: Equal To
Value: 1

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48480
  • Thanks: 8283
  • Karma: 1443
10 years 2 weeks ago - 10 years 2 weeks ago #250990 by krileon
Replied by krileon on topic CB Conditonal Fields?
Just be sure to test [gids] usage with a user that has multiple usergroups to ensure it's behaving fine. If it does implode it'll implode to ID|*|ID|*|ID so you'll need to be sure your conditional can parse that properly. You won't need to worry about any of that with the above suggested usage.


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: 10 years 2 weeks ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum