With OG installed, your 'group' content type will have a 'Title' eg: "Pony Trekking Club" and you can then use CCK to add another field called something like 'field_short_title' eg: "ponytrekking"

We can use this short title for the URL of the group's home page - PathAuto takes [field_short_title] as the argument for the url, and the home page is created as example.com/ponytrekking

We'd then like each post in that group to take the form of example.com/ponytrekking/omg_ponies
However - all that's available to pathauto is OG's field [ogname] - the name of the organic group this post belongs to.
To achieve the desired URL, an option of 'the field_short_title of the organic group this post belongs to' needs to be available to the pathauto system.

(If this is really an issue for PathAuto, that's not picking up on the available CCK field, let me know.)

Many thanks, Rob

Comments

yched’s picture

Project: Content Construction Kit (CCK) » Pathauto
Version: 5.x-1.5 » 5.x-1.1
Component: General » Code

I don't think this is for CCK - maybe for pathauto ? (this might very well be addressed by forthcoming Pathauto 2.0 / Token module)

rob101’s picture

Grand, thanks for your reply, yched. Let me also take the opportunity to say thanks for CCK. Where would we be without it?
(D4.6 I guess.)

rob101’s picture

Grand, thanks for your reply, yched.

greggles’s picture

rob101 - can you confirm that you are using pathauto version 5.x-1.1? Or are you using 5.x-2?

Could be you are "bitten" by this feature request/bug - http://drupal.org/node/139652

greggles’s picture

though I forget, of course, that token has already implemented the cck code.

Anyway, it would be good to confirm the version you are using because cck fields are working fine for me using some mixes of versions of pathauto...

greggles’s picture

Status: Active » Closed (won't fix)

I don't plan on doing anything for this in the 5.x-1.x branch. As yched mentions, in Pathaut5.x-2 (reliant on Token 5.x-1.x-dev) this is basically solved.

Except there's a little tiny bug that causes it to work but not provide help text. That bug is a duplicate of http://drupal.org/node/162595 and I have a fix for that I'm about to commit.

najibx’s picture

You mentioned " ...this is basically solved." but this issue status is "Won't fix". And I'm still experiencing this problem.

I am using ....
Token 5.x-1.x-dev (2008-Jul-19)
Pathauto 5.x-2.x-dev (2008-Jul-12)
Content Construction Kit (CCK) 5.x-1.7

putting this :
[field_site_url-raw]/[title-raw]

I get this :
/%5Bfield_site_url-raw%5D/testing-page

Thank you for you kind attention :-)

greggles’s picture

@najibx - please open a new issue and provide more details about the nature of the "field_site_url" field.

najibx’s picture

Hi greggles ,
I think, no need to open new issue as my requirement is the same. Basically I want to set path to all content type with the cck field i define in og depending which og they choose to be published in.

the [field_site_url-raw] is equivalent to [field_short_title] in Rob scenario.
As for the group content type itself, this field_site_url is there so user can enter. So it work just fine when adding group. Simply add [field_site_url-raw] for other content type would not do the trick, isn't?

Can you advise how it should be done?

greggles’s picture

Title: Make Fields Available to PathAuto » Provide OG node tokens (cck fields, etc.) for nodes within an OG
Project: Pathauto » Organic groups
Version: 5.x-1.1 » master
Component: Code » og.module
Status: Closed (won't fix) » Active

Aha. So, basically the goal is to provide tokens from cck fields in the the OG parent node.

In that case it should be filed against the OG module and I imagine that something like [og_field_site_url] would make the most sense, but I'm not sure whether or not it should be provided since that would make the parsing/creating of og tokens quite expensive in terms of processing speed. It basically requires two node_render (plus other stuff) for each hook_token_values call (one for the node itself and one for the og parent node).

Moshe?

moshe weitzman’s picture

I'm not too keen on this only because of token module's current architecture. If we can do it so that tokens are loaded as demanded, then this makes sense. Until then, I think this makes a bad problem worse.

greggles’s picture

Status: Active » Postponed

Agreed.

najibx’s picture

i see. here's my way around, at least to satisfy my need.
Instead of defining [og_field_site_url] as tokens for other content type to use in pathauto, I just use OG name (OG title) as the short URL. Then I have cck field for the long title.

that way other content type can use [ogname-raw] in their path.

I am not worry about the of OG title to show up as short form since I can modify the og views list, and change the form and labeling a little. Furthermore, I use og_panel and infact i hide the OG title page from showing up in panel.

But when publishing content to og, the short OG name is listed, so need to hack og.module, and may can utilize og description instead.

Thank you for the advise.