Posted by smithn.nc on June 4, 2009 at 4:01pm
| Project: | Subgroups for Organic groups |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I've been using Subgroups to create nested groups representing divisions in an organization. This has become a problem as far as Path Auto goes, because it can only generate a path based on a single group. As it is, I've got to let all the group content sit in content/[title-raw], because there's no way to correctly place it. It'd be really helpful if Subgroups provided its own tokens that correctly output the complete group path.
Comments
#1
+1
#2
This is actually a bit of a duplicate of this post http://drupal.org/node/293325 but I think this is a more generic issue.
#3
+1
As mentioned in #867124: Assign subgroups/parent groups while creating new group, I'm currently working around the lack of subgroup tokens by setting up a taxonomy that mirrors my group hierarchy, then making pathauto use [termpath-raw] for group node aliasing.
#4
Token support would be helpful. What kind of tokens do we need?
- Parent group title
- parent id
- full lineage (excluding the current node)
#5
Those sound good for starters. I think the full lineage is definitely the most important one initially.
Maybe a "group type lineage" would be useful to someone as well? I can't think of a good use case, but taking a useless geographic example: if "full lineage" gave a path of europe/france/paris, then the "group type lineage" might give a path of continents/countries/cities/france. Of course, that would assume the user had created different content types for each level in the hierarchy.
Possibly also title/type/id tokens for the top level of the hierarchy?
#6
Here's a patch that adds the following subgroup specific tokens:
The ['subgroups-path'] and ['subgroups-path-raw'] tokens will respect pathauto's "General Settings" and "Punctuation Settings"
I chose not to add tokens that build a path based upon the node types of all parent groups because in order to get the types of each group in the path I would need to use node_load. That seems like too much overhead and I don't want to write a custom sql statement to get the data because that's no the "drupal way".
If someone absolutely needs it than we can discuss it more.
Let me know if there's any other types of tokens we need.
#7
Lovely! The path tokens work perfectly on my test site. Haven't tried the title and id tokens but the code for them looks fine.
Thanks!
#8
this patch has been committed.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.