Groups and friendlier usernames in Opigno?

Xtrobe
Forums
Hi, A teacher was asking if there was a way for them to create groups from within Opigno that would not necessarily be associated to a class (ex. people grouped into Marketing, Finance, IT, etc). It would be of great help to them if this feature would be available. Also, they are asking if it's possible to view full names instead if usernames within the class. we use a naming convention within our usernames (ex, RR12 or tra123), and they find it difficult to sift through the names, especially since we are dealing with more than 400 entries. Many thanks in advance!
James Aparicio

Hi Xtrobe,

Hi Xtrobe, You can create a new content type, Lets say "Group". and in the content type settings, you find a tab called Organic Groups. There you select the Group option to make it a group. After that, you can just create several group nodes. One called Marketing, another one called Finance, etc. Inside each of these Group nodes, you select the users you want. Then you just have to implement the "what you want to do with these groups", such as filters and such. Regarding the users, you can create fields inside the users account. After that you have to replace the code that displays the username to display the user name field you created. Best regards
Xtrobe

Thanks for the reply, James.

Thanks for the reply, James. For the users, I'm actually looking at the Mass Add. Is there a way to display the first name and last name (fields I created) using Profile2?
Xtrobe

Sorry, kindly disregard

Sorry, kindly disregard Profile2. I'd like to use the new fields that were used within the profile account to reflect on the mass add tool for the class. Thanks.
James Aparicio

Hi Xtrobe,

Hi Xtrobe, You can find the code for this inside the opigno_simple_ui module. (opigno_simple_ui.og.inc) Best regards
Xtrobe

Thanks, James. To verify,

Thanks, James. To verify, these are lines 107-113? $users = entity_load('user'); foreach ($users as $uid => $account) { if ($uid && !in_array($uid, $exclude)) { $form['massadd']['#options'][$account->uid] = $account->name; } } so, this is were I place my two variables for their names? field_firstname and field_last_name?
James Aparicio

Yes, where you have

Yes, where you have $form['massadd']['#options'][$account->uid] = $account->name; You have to check if the $account variable already has the fields you created, if it doesnt you have to load them and change to $form['massadd']['#options'][$account->uid] = $yourfirstname . " " . $yourlastname; By the way, you should create a new module and do a form alter instead of changing it directly inside the opigno_simple_ui module. Best regards
Xtrobe

Acknowledged. Thank you!

Acknowledged. Thank you!
Xtrobe

I'll have to do this

I'll have to do this alteration for now, since I'm not really a Drupal programmer. I'll just keep note of this adjustment during updates.
James Aparicio

Let us know if everything

Let us know if everything goes as expected. Best regards