Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Thanks for this great module.
Is there a possibility to create a view-tree with grouping fields? I'm sort of looking for something like this.
Project 1
(Tree 1)
Task 1
Task 1.1.
Task 2
Taks 2.2
Project 2
Task 3
Task 3.1
Taks 3.2
Where a task has a parent task and an project.
If there is a place to start i'm willing to test / help.
Comment | File | Size | Author |
---|---|---|---|
#6 | views_tree-group-by-field-1659028-5.patch | 2.77 KB | devad |
#2 | views_tree_group_by_field-1659028-2.patch | 1.32 KB | nicholas.alipaz |
Comments
Comment #1
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedWould like to say that this would be a nice addition, one use case is a view of terms grouped by vocabulary names:
Comment #2
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedHere is a patch against git 7.x-2.x branch. It is working for me and shouldn't have any regressions for current functional non-grouped views.
Comment #3
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedBTW, this made possible a list of all taxonomy terms on my site grouped by vocabulary in weighted hierarchical order. There is no other contributed solution for this that I have found.
Example can be seen in right sidebar here:
http://pixarcarsdiecastwiki.com/
Comment #4
devad CreditAttribution: devad commentedThanks Nicholas. It worked for me as well.
However, I left 'uses grouping' option as TRUE.
- 'uses grouping' => FALSE,
+ 'uses grouping' => TRUE,
It would be nice to have this patch refreshed, tested and commited.
(Patches are not in my skills)
Comment #5
devad CreditAttribution: devad commentedComment #6
devad CreditAttribution: devad commentedPatch refreshed against latest .dev
#4 change included
Comment #7
NWOM CreditAttribution: NWOM commentedThe following error is shown after applying the patch:
Notice: Undefined variable: grouping_enabled in theme_views_tree_inner() (line 136 of /var/aegir/platforms/drupal-7.39/sites/test-dropzone.soft-nrg-portal.de/modules/views_tree/views_tree.module).
Comment #8
devad CreditAttribution: devad commentedWhat patch did you apply nwom? #2 or #6 ? Against 2.0 or against 2.0-dev ? Did you apply the patch manually or automatically?
If you can post all lines of your function "theme_views_tree_inner($variables)" together with line numbers after you have applied the patch this would help to find why you get undefined variable notice.
Comment #9
NWOM CreditAttribution: NWOM commentedI patched #6 manually on 2.0-dev. I hadn't mentioned this since the thread's Version is set to 7.x-2.x-dev and #6 was the last patch made for the latest dev.
I'm not in the office again until Monday, and can try and debug and automatically apply it then. I assume it's just a small PHP5.5 incompatibility notice where one of the variables isn't declared with "isset".
Comment #10
scottsawyerI wound up solving this with Views Field View and multiple view displays, wanted to share in case it helps anyone with this issue in the future.
I needed to create an organizational chart with Committees, Committee Positions, and Committee Members
Committees and Committee Positions are Vocabularies, Committee Positions can appear in one or more Committees (term reference field), and a Committee Member is a Profile2 User with a Committee Position (term reference).
I create 3 views:
View 1 - Users
Display: Block
Format: Tree
Fields:
- Name
- Phone Number
Relationships:
- User profile
- Term from profile field ( field_committee_position )
Contextual Filter:
- Term ID ( relationship term from profile field )
Sort:
- Term Weight ( relationship term from profile field )
View 2 - Taxonomy Terms
Display: Block
Format: Tree
Fields:
- Term Name
- Term ID ( exclude from display )
- View -> View 1 [block] pass in [tid]
Relationships:
- Term from field ( field_committee )
Contextual Filter:
- Term ID ( relationship from field )
Sort
- Term Weight ( relationship from field )
View 3 - Taxonomy Terms
Display: Page
Format: Tree
Fields:
- Term Name
- Term ID ( exclude from display )
- View -> View 2 [block] pass in [tid]
Now I get:
Org Chart