I understand that new tokens can be a never-ending annoyance, but I think this one should be very useful when using og with pathauto. The idea is that the posts in a group can have their aliases look like children of the group node's alias. The patch adds an [og-path] token to allow it. The patch is working for me.

Comments

moshe weitzman’s picture

Interesting. Are you using pathauto for groups as well? If so, couldn't you mimic its logic for group posts and just add a node title at the end (for example).

jody lynn’s picture

Yeah, I'm using pathauto for groups but I can't mimic the logic because I'm using tokens for the groups other than just [node-title] or [node-id]. (The group paths are based on taxonomy of the group node in my case, but you would have the same problem if you based your group's paths on a field within the group or many other tokens or if you manually assigned group paths.)

ariana’s picture

This is just what we needed! We used your patch and it's working great. Thank you so much.

owen barton’s picture

Version: 5.x-7.0-rc5 » 5.x-7.3
StatusFileSize
new1.49 KB

Just hit this same issue myself, and came up with a near identical patch. My version uses the same naming/description convention as the pathauto URL alias tokens (e.g. bookpathalias, termalias etc), which I think is more correct (path should indicate only a system path such as node/123, but we actually want the alias) and is better for consistency. There is also a minor indenting issue that is resolved.

The reason why I need this is for breadcrumbs with custom_breadcrumbs or workflow_ng - I can use node/[node:og-id] to create the alias to the group, but this falls down when I want to link to a sub-path of a group (i.e. groups/blah-group/activities) but but making "groups/blah-group" available as a token I can do this. I can't add the title to the path as Moshe suggests because it needs to be pathautoized (i.e. I would get "groups/Blah Group/activities", which doesn't work).

I am happy to roll a D6 patch if anyone is interested.

daniorama’s picture

Interested! Maybe you could help with creating the same for OGsubgroups in D6. I tried to create Breadcrumbs and Paths, but I didn't manage to do it... Any help would be really appreciated. Thanks!

cncoleman’s picture

A D6 patch would be very helpful. Thank you.

emlomar1’s picture

Thank you!! That's exactly what I was looking for :)

owen barton’s picture

Version: 5.x-7.3 » 5.x-8.x-dev
StatusFileSize
new1.58 KB

Updated patch for 5.x-8.x
A Drupal 6 patch would be welcome :)

drupalok’s picture

A Drupal 6 patch would be VERY welcome :)

sethcohn’s picture

Version: 5.x-8.x-dev » 6.x-2.x-dev
Assigned: Unassigned » sethcohn
StatusFileSize
new1.1 KB

Looks good to me. I'll roll this into the next OG 5.x version...

Here's a patch for 6.x-2.x-dev so we stay consistent.

moshe weitzman’s picture

Version: 6.x-2.x-dev » 5.x-8.x-dev
Status: Needs review » Reviewed & tested by the community

Committed to 6--2. Seth will commit to 5--3

steinmb’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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