Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

User Type Displayed on List

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
9 years 3 weeks ago #271626 by xengent
User Type Displayed on List was created by xengent
Im trying to display the user group on a user list (or text indicating the user's group on a list.

I tried creating a delimiter field (with a substitution in it) and including it on the list, but cant get the right code.

In the field "Custom HTML" type, I tried:

[cb:if gids includes "2"]Group 2[/cb:if]

or

[cb:if user="#displayed" gids includes "2"]Group 2[/cb:if]

Can't get this to work. Any suggestions?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
9 years 3 weeks ago #271638 by krileon
Replied by krileon on topic User Type Displayed on List
To condition against the profile owners groups you'd use the below usage.

[cb:if gids includes "2"]I have Registered Usergroup[/cb:if]

Please ensure the ID you specify is the actual ID of the usergroup found in the far right column of usergroup management. By default the ID of 2 is the Registered usergroup.


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.

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
9 years 3 weeks ago #271647 by xengent
Replied by xengent on topic User Type Displayed on List
This isn't working for me. I created a cb field that is HTML, and I inserted

[cb:if gids includes "12"]I have Registered Usergroup[/cb:if]

in the HTML of that field.

I then have that field as one that shows on a user list. When I go to the user list on the front end, it just shows a dash, even though I know that these users listed, are apart of that group id "12".

Please advise.

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

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
9 years 3 weeks ago #271648 by xengent
Replied by xengent on topic User Type Displayed on List
I must be doing something wrong on the field creation itself. The list can display the title of that field without any problems.

When I do a "does not include" like this:

[cb:if gids !includes "12"]I have Registered Usergroup[/cb:if]

it works.

Could it be because the users listed are apart of two group id's and I need to specify both???

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
9 years 3 weeks ago - 9 years 3 weeks ago #271650 by krileon
Replied by krileon on topic User Type Displayed on List
The gids is exact matching. It doesn't inherit. So if the user is Author and you check against Registered it won't match, because the user only has Author. You need to use the below usage for inheritance.

[cb:if usergroup includes "2"]I have Registered Usergroup[/cb:if]

I've updated the substitutions tutorial to example the above usage instead of gids usage. Please note conditioning against usergroups can be unreliable. For example Super Users is not a Registered user. So if you check against Registered they won't pass since they don't have the Registered usergroup.


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: 9 years 3 weeks ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum