Skip to Content Skip to Menu

[SOLVED] How to sort GroupJive groups in a catergorie alphabetical?

  • NicoFaaij
  • NicoFaaij
  • OFFLINE
  • Posts: 114
  • Thanks: 10
  • Karma: 1
10 years 8 months ago - 10 years 6 months ago #240760 by NicoFaaij
Hi,

The Groups in (a category of) GroupJive are sorted by creation date. So it's difficult to find a group in a long list (without search) and the order in not logical for the end-users.

Wat is the best way to get the groups orderd alphabetical?

Many thanks in advance,
Nico
Last edit: 10 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 8 months ago #240820 by krileon
Sorting is based off the Ordering value. It always adds new groups first. You can manually change the ordering within GJ > Groups. There is no parameter to adjust ordering or anything of the sort. You would need to manually edit the usage in code to change how it orders.


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.
The following user(s) said Thank You: NicoFaaij

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

  • NicoFaaij
  • NicoFaaij
  • OFFLINE
  • Posts: 114
  • Thanks: 10
  • Karma: 1
10 years 6 months ago #243634 by NicoFaaij
Hi,

Can anybody just give my a hint in which php file or where I should change the sql sort query to get them out of the database sorted on name? It seems to me a fair question to get it sorted by group name.

Many thanks in advance,
Nico

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 6 months ago #243658 by krileon
You need to modify the getGroups function of the below file.

components/com_comprofiler/plugin/user/plug_cbgroupjive/cbgroupjive.class.php

The default ordering is set with the $order variable. Aside from that I can not advise you any further as we do not support core edits.


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.
The following user(s) said Thank You: NicoFaaij

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

  • NicoFaaij
  • NicoFaaij
  • OFFLINE
  • Posts: 114
  • Thanks: 10
  • Karma: 1
10 years 6 months ago #243661 by NicoFaaij
Hi Kyle,

Thanks, that is more than enough info for my to solve this issue.

Kind regards,
Nico

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

  • NicoFaaij
  • NicoFaaij
  • OFFLINE
  • Posts: 114
  • Thanks: 10
  • Karma: 1
10 years 6 months ago - 10 years 6 months ago #243736 by NicoFaaij
Hi Kyle,

I found out that a better way to sort them is an CB Auto Action that fires a SQL Query on a gj_onAfterCreateGroup event to change the order of the ordering field in the #__groupjive_groups table.

Something like:
Code:
SET @cnt = 0;UPDATE #__groupjive_groups SET ordering = @cnt := (@cnt+1) ORDER BY name;

So I don't have to do a core edit, and have to say again that I like your Auto Actions ;-)

Regards, Nico
Last edit: 10 years 6 months ago by NicoFaaij.
The following user(s) said Thank You: krileon, jojo12

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

Moderators: beatnantkrileon
Powered by Kunena Forum