If you have projects acting as OGs on your site, and you have content types which are not directly provided by project (e.g. project_issue or project_release) which can be associated with your OG-ified projects, and you want those to share a similar URL alias (e.g. project/[shortname]/something), you need a new token to use in pathauto. Basically, we want the project shortname, but for the OG that the post belongs to, not directly a "parent" project, since not all node types directly reference a project node.
I'm not entirely sure what the description for this token should be. OG uses, e.g. "Title of top group", but it's not really "top", it's really "first OG we find that's also a project", but that's too clumsy... ;)
Anyway, patch coming soon...
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 546528-1.og_project_shortname_token.patch | 1.35 KB | dww |
Comments
Comment #1
dwwI went with: "The short name of the first group which is a project". Probably could do better, if anyone has any bright ideas.
Tested and working nicely on a site on my laptop where projects act as OGs and story nodes are associated with OGs... The definition of "Top" appears to just be "alphabetically first", which is slightly weird, but not sure we can/should do any better. I'm guessing in the majority of cases, things will only be posted to a single project/group...
Comment #2
gregglesIt's quite common in token when there are multiple "things" to just use the top one. You can name it "thing" and in the description say "lowest weight" or "first in alphabetical order". "First" is a little ambiguous - maybe "The short name of the group which is a project with the lowest node ID number." ? "First" is probably fine too. This is a pretty specific use case!
Comment #3
dwwThanks for the comment... "First" it is. ;) Committed #1 to HEAD.