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...

CommentFileSizeAuthor
#1 546528-1.og_project_shortname_token.patch1.35 KBdww

Comments

dww’s picture

Status: Active » Needs review
StatusFileSize
new1.35 KB

I 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...

greggles’s picture

It'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!

dww’s picture

Status: Needs review » Fixed

Thanks for the comment... "First" it is. ;) Committed #1 to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.