Skip to Content Skip to Menu

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

Hide nested groups on "all Groups" list

11 years 6 months ago #225609 by nopersonalive
Hide nested groups on "all Groups" list was created by nopersonalive
Hello,

I need a menu link for a list of groups that have children groups in it. Or simply put, I need to hide the nested groups from the "All Groups" type of menu link.

I have tried to find the option in every NESTED tab in configuration or similar, but everything points to the ability to create nested groups, not to show or hide them.

Sorry if Im being blind. Can you help me?

Thank you.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 6 months ago #225661 by krileon
Replied by krileon on topic Hide nested groups on "all Groups" list
You can't, All Groups does exactly what it says it does; it shows All Groups. You would need to edit showGroupAll in component.cbgroupjive.php and adjust the query usage to explode groups with a parent id (sorry I can't help beyond this, 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.

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

11 years 6 months ago - 11 years 6 months ago #226068 by nopersonalive
Replied by nopersonalive on topic Hide nested groups on "all Groups" list
Thanks for pointing me on the right direction.

I understand "All Groups" does exactly what its supposed to. I was asking if there was a way to identify the nested groups from the parent groups once you are inside the "All Groups" view.

I applied id's and classes so that I can now apply styles to a specific group, to all of its children groups and to all of the nested groups inside either a category or another group.

It is a hack, but I think it should be implemented as a feature. Heres how:

Right now, every group inside the "All Groups" view has exactly the same classes. We want to have specific id's and parent classes. So each group will end up having:
  1. An id attribute that matches that group's id
  2. A class name with the group's category id number: "cat1", "cat2", "catx", etc.
  3. A class name with the group's parent id number: "parent21", "parentx", etc.


To do that, find:

components/com_comprofiler/plugin/user/plug_cbgroupjive/templates/default/group_all.php

Go to line 61. Where it says:
Code:
$return .= '<div class="gjContent row-fluid">'

Replace it with this:
Code:
$return .= '<div class="gjContent row-fluid cat' . $category->get( 'id' ) . ' parent' . $row->get( 'parent' ) . '" id="group' . $row->get( 'id' ) . '">'

Did I explain myself?

What do you think?
Last edit: 11 years 6 months ago by nopersonalive. Reason: code editor crops last part of my code

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

11 years 6 months ago #226069 by nopersonalive
Replied by nopersonalive on topic Hide nested groups on "all Groups" list
Code editor is not letting me display the last part of the solution code.

it should end with .....get( 'id' ) . '">'....

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 6 months ago #226129 by krileon
Replied by krileon on topic Hide nested groups on "all Groups" list

I understand "All Groups" does exactly what its supposed to. I was asking if there was a way to identify the nested groups from the parent groups once you are inside the "All Groups" view.

It already does. It appends the linked name of its parent right after its category unless you removed it. This is done on line 65 as follows.
Code:
. '<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ' - ' . $category->getName( 0, true ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'

It is a hack, but I think it should be implemented as a feature. Heres how:

Template adjustments aren't hacks so change away. Templates in GJ can also be partial. So create a new template folder (e.g. "mytemplate") and place your group_all.php file in it then select your template from backend. It'll then use your group_all.php for that display, but will use all missing files from the default template folder. This allows for partial templates that won't be lost when you upgrade GJ.

Right now, every group inside the "All Groups" view has exactly the same classes. We want to have specific id's and parent classes. So each group will end up having:

I see, no it doesn't have classes that distinguish it from a nested or non-nested group.

What do you think?

If it works for your needs then it's fine.


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