Hello,

Thank you very much for this flexible and powerful module! :)

Now I have this path and really don't know how to grab the path to the "group"-page.

My path:
groups/[og-id]/announcements/[title-raw]

My Tokens and paths:
Groups -> groups
[og-name] -> groups/??????
Announcements -> groups/[og-id]/announcements
[title-raw] -> node/[nid]

I have everything but the path to the group-page.

Can anybody help me out?

Thanks a lot! :)
Stefan

Comments

MGN’s picture

I think you want [ogname] (no hyphen). For example:

Titles:
Groups
[ogname]

Paths:
og
og/[ogname]

design.er’s picture

Thanks for you help but unfortunately this solution does not work.
I always see [ogname] instead of the actual group name.

FYI: I'm using Pathauto for creating URL aliases.

MGN’s picture

Can you describe what kind of page the breadcrumb is being applied to? Is it a node? And is that node affiliated with a group?

design.er’s picture

Sorry for the delayed reply.
Yes, it's a node (i.e. called 'announcement') affiliated to a group. If I publish a new announcement, the following breadcrumb structure should appear:
groups/[name-of-the-group-this-node-belongs-to]/announcements/[title-of-the-current-node]

The problem is that the group name can not be showed. If I set [ogname] I also see only '[ogname]' but not the actual name of the group this node belongs to.

The same questions is for groups/[og-id]/announcements <- a view generated page. Here I also cannot get the group name. Maybe we need a PHP code inside the view argument to check the URL for $group->gid?

Please let me know if you need more information.

Thanks a lot! :)
Stefan

MGN’s picture

Looking into this, I've learned that if you are viewing a group node, then the og tokens are not set. This may make sense because [ogname] would be the title of the node (so why not use [title] instead?) and [og-id] would be the same as [nid]. If you try to use the og tokens on a group node, they are quietly removed, so you wouldn't see the token in that case.

For group posts, I've found that as long as the audience box is checked (so the node is posted into a group), the og tokens will work. I just checked with og 6.x-2.0 and the current dev version of custom breadcrumbs and everything seems to work fine.

What versions of these modules are you working with? Be sure you are using the most recent 6.x-2.x-dev release for custom breadcrumbs.

What kind of breadcrumb are you creating for each page? The announcement page should be a node-type custom breadcrumb. The view should be a view-type custom breadcrumb

Just to be clear, verify the type of custom breadcrumb that you are creating and copy the exact contents of the titles and paths form fields (as I did in #1 above) for each. You might also want to indicate what custom breadcrumbs modules you are using, and what configuration options you have suggest.

Also can you further explain the view - what is the type of display? Are you using arguments? etc.

I haven't tried it yet, but I would expect that if the view returns nodes that are group posts, then the og tokens should work in the custom breadcrumb. But since you aren't getting the correct behavior when viewing individual nodes, lets start with that and figure out the view problem later.

MGN’s picture

I just set up a test view showing group posts using an argument to select the group. I then set up a custom_breadcrumb_views breadcrumb for this view, and used the og tokens in the title and path. Everything worked as expected. This quick test was done using og 6.x-2.0 with the og and og views integration modules enabled and custom breadcrumbs 6.x-2.x-dev (latest) with custom breadcrumbs for views module enabled.

[Note if the view is empty (no posts in the group) then the og tokens were not replaced and showed up as [ogname] or [og-id] in the breadcrumb. Again this is the expected behavior for an empty view, since a valid node object is needed to do the token replacement.]

Glenmoore’s picture

Hi, I think I have a similar problem.
I have a view that displays a list of group posts on which my Custom Breadcrumbs work well using [ogname] in a similar way to that described above.
Eg
Titles
groups > group type > group name > posts
corresponding to
Path
groups/group_type/[ogname]/posts

However, when I am in the view (listing the group posts) and I click on the breadcrumb element "group name" I expect to be taken back to the page "groups/group_type/[ogname]" ie the group homepage. Instead, the following path appears in the address bar
"groups/group_type/group%20name" where "%20" replaces any hyphens that appear in that name and I am taken back to "groups/group_type".
It looks like the group token is no longer set, I guess.

I am using D 6.14
OG with Views integration 6.x-1.3 and
Custom Breadcrumbs 6.x-2.x dev

MGN’s picture

@Glenmoore, I am not sure I understand your explanation. Please let me know if I have this right. Are you saying the custom breadcrumbs token replacement works well when on a group post, but you are not getting token replacement of [ogname] on the view page?

Is the breadcrumb setup that you listed for a node-type breadcrumb? or a custom_breadcrumb_views breadcrumb?

Please copy and paste exactly what you have for the titles and paths sections....you are only showing one title and one path above. Each part of the breadcrumb should be on a separate line (as described in the documentation).

It sounds like [ogname] is being replaced by (literally) "group name" ? Is this correct? Is "group name" actually the name of the group? If "[ogname]" isn't appearing in the link then the token is being replaced.

Glenmoore’s picture

Sorry, I'll try to make it clearer. Here goes.
I have a View which is a list of projects posted by a specific company (of type "Construction"). The company is set up as a group.

I am using a Views breadcrumb set up as follows.

Titles:
Companies
Construction
[ogname]
Projects

Paths:
companies
companies/construction
companies/construction/[ogname]
companies/construction/[ogname]/projects

My View is accessed via a link in an associated Block and displays perfectly well at the path companies/production/%/projects (Argument Organic Groups: Groups, Title %1, Breadcrumb (empty))

So, to access the projects of the company "EMJ Building" I might:
1) Go to /companies
I get a list of companies (breadcrumb > Companies)
2) Click on "Construction", go to /companies/construction (breadcrumb > Companies > Construction)
3) Click on "EMJ Building", go to /companies/construction/emj-building (breadcrumb > Companies > Construction > EMJ Building)
This is the comapany's home page on which a block is displayed of its latest projects. A the bottom of the block is a link to view all projects.
4) I click on the link, go to /companies/construction/emj-building/projects (breadcrumb > Companies > Construction > EMJ Building > Projects)
Everything works the way it should so far.

5) HOWEVER, when I now click on the breadcrumb "Projects" I get sent to
/companies/construction/EMJ%20Building/projects (a page it doesnt recognise, of course) with a breadcrumb of "> Companies > Construction > [ogname] > Projects"

and if I click on the "EMJ Building" breadcrumb I get sent to /companies/construction/EMJ%20Building with a breadcrumb of "Companies > Construction" (and nothing else)

ie "[ogname]" is only appearing in the breadcrumb trail on the way 'back' but is being replaced perfectly well on the way 'forwards'.
Hopefully, this is a little clearer but if you need anything else please let me know.
thanks for your time on this.

MGN’s picture

Thanks. This is much better. It sounds like you have views pages at companies, companies/construction and companies/construction/%/projects, and a group node at /companies/construction/emj-building. And it seems there are two separate problems:

1. [ogname] displays "EMJ Building" - good for the breadcrumb title, but for the path you want 'emj-building'. I think you want to clean the path using pathauto rules. You can do this with the special identifier <pathauto>. See the fieldset on the create breadcrumb page or the readme file for further explanation. So for the paths, I would try

<pathauto>|companies/construction/[ogname]
<pathauto>|companies/construction/[ogname]/projects

Note: you might also try [ogname-raw] if [ogname] doesn't work as expected.

2. Organic groups doesn't provide the [ogname] token on the group node, so you'll want to set up a custom_breadcrumbs node-type breadcrumb for that page, and use [title] instead of [ogname].

Glenmoore’s picture

Thank you so much, just copied your recommendation and it now works perfectly.
Fantastic module!

MGN’s picture

Status: Active » Fixed

Great! Glad to hear its working for you.

Status: Fixed » Closed (fixed)

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