Skip to Content Skip to Menu

Use native joomla group membership as a cb field ?

  • moomola
  • moomola
  • OFFLINE
  • Posts: 37
  • Thanks: 0
  • Karma: 0
7 years 5 months ago - 7 years 5 months ago #294373 by moomola
Hello,

I would like to use the native joomla user group information as if it was a standard community field.

Use case would be :
  1. Display the user's groups in the user cb profile
  2. Create cb lists of users based on joomla groups
  3. If possible, allow the administrators to change user groups directly from the profiles

Is that possible and how ?

Thanks,

---
Olivier
Last edit: 7 years 5 months ago by moomola.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
7 years 5 months ago #294402 by krileon

Display the user's groups in the user cb profile

You can query for their usergroups using CB Query Field or use a Custom HTML field and substitute for them. See the below substitution tutorial. Examples as bottom for IF substitution usages.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

Create cb lists of users based on joomla groups

You can select what usergroups are included on your userlist when creating your userlist. See CB Manual for details.

If possible, allow the administrators to change user groups directly from the profiles

Backend only, but I guess you could force it with CB Auto Actions and its Usergroups action.


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.

  • moomola
  • moomola
  • OFFLINE
  • Posts: 37
  • Thanks: 0
  • Karma: 0
7 years 5 months ago - 7 years 5 months ago #294418 by moomola
Thanks Krileon.

About substitution, is there a simple page with the list of FIELDS that could by used ?

Actually, I had found this trick based on this Nant's article :
magazine.joomla.org/topics/item/133-CB-Delimiter-Field-Magic

I tryed different options ( for example : [usertype] [usergroup] ) but could'nt get it.

BTW, I found out that joomla groups WHERE available in user profiles, and as far as I understand it this is embended in the core "params" field.

Unfortunatly, this is only available in the backend (I would need the user groups to be displayed in the frontend).

Moreover, I didn't find how to specifically retrieve the groups.

If I ask for this to be displayed in a custom HTML field :

My params are [cb:userdata field="params" user="#me" /]

I get this displayed (nothing about groups) :

My params are {"admin_style":"","admin_language":"","language":"","editor":"jce","helpsite":"","timezone":"Europe\/Paris"}

BTW this : My timezone is [cb:userdata field="timezone" user="#me" /]

Doesn't work.

Thanks for your help.
Last edit: 7 years 5 months ago by moomola.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
7 years 5 months ago #294432 by krileon

About substitution, is there a simple page with the list of FIELDS that could by used ?

Yes, within your own install in CB > Field Management. It is not possible for us to list what fields you've created.

I tryed different options ( for example : [usertype] [usergroup] ) but could'nt get it.

You do not substitute in their usergroups directly as such a substitution does not exist. You have to condition for them. Example as follows.

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

Example of this is shown at bottom of our substitution tutorial below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

BTW, I found out that joomla groups WHERE available in user profiles, and as far as I understand it this is embended in the core "params" field.

Usergroup management has never been a part of frontend profiles.


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.

  • moomola
  • moomola
  • OFFLINE
  • Posts: 37
  • Thanks: 0
  • Karma: 0
7 years 5 months ago - 7 years 5 months ago #294437 by moomola

krileon wrote: About substitution, is there a simple page with the list of FIELDS that could by used ?
Yes, within your own install in CB > Field Management. It is not possible for us to list what fields you've created.


oops, of course :silly:

I meant "external" fields such as [usertype] described here :
www.joomlapolis.com/forum/130-cb-123-general-discussion/139560-solved-show-users-qgroupq-on-profile-page
(it sounds this doesn't work anymore BTW ?)

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


This doesn't display the list of joomla groups the user is member of, which is what I would need to do really.

Usergroup management has never been a part of frontend profiles.


It is part of backend profiles so that's ok to me.
Last edit: 7 years 5 months ago by moomola.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
7 years 5 months ago #294448 by krileon

I meant "external" fields such as [usertype] described here :
www.joomlapolis.com/forum/130-cb-123-general-discussion/139560-solved-show-users-qgroupq-on-profile-page
(it sounds this doesn't work anymore BTW ?)

You're referencing a 6 year old post. That substitution does not exist.

This doesn't display the list of joomla groups the user is member of, which is what I would need to do really.

There is no substitution for that. You do an IF condition against each of the usergroups you want to display. Your alternative is to use CB Query Field and query for that information.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum