There should be an option to turn of OG breadcrumbs so that posts that belong to a group can still use normal Drupal breadcrumbs if they are placed in the menu tree. After searching for a solution I found a site with a solution (http://www.aidanfindlater.com/2008/11/10/drupals-organic-groups-messing-...) but it requires hacking the module.
The only change necessary is to switch og_get_breadcrumb in og.module to drupal_get_breadcrumb(), but there should be something built in to make this an option (if not the default).
| Comment | File | Size | Author |
|---|---|---|---|
| #37 | og-crumbs-2.patch | 1.67 KB | acbramley |
| #36 | og-dev-crumbs-2.patch | 1.5 KB | acbramley |
| #34 | og_disable_breadcrumbs_2-1.patch | 3.46 KB | wilco |
| #28 | og_disable_breadcrumbs.patch | 3.46 KB | thepanz |
| #22 | og-crumbs.patch | 1.69 KB | erykmynn |
Comments
Comment #1
davidcgutman commentedNote: In case anyone else wants to do this, his advice doesn't seem to quite work, but if you remove all the references to drupal_set_breadcrumb in og.module OG will no longer change Drupal's default menu breadcrumbs.
Comment #2
moshe weitzman commentedbreadcrumbs are so pitiful in D6 I hardly feel like fixing this. And D7 is looking the same unless someone leads the charge. I would take a patch for this if it shows up.
Comment #3
scedwar commentedIs this something that Custom Breadcrumbs could take on?
It already works neatly with og posts (nodes only), by providing tokens for the og name, url etc.
There are discussions here about how to fix it for views: http://drupal.org/node/215475
Comment #4
i.chris.jacob commentedI second this request to be able to disable OG breadcrumbs... they currently override my Menu Breadcrumbs - which is not what I want. I also don't want to have to hack OG module to 'turn off' this feature. Please please ad it as an option in the admin area.
Gold points if you can make it only use OG Breadcrumb when a Menu or Taxonomy breadcrumb does not exist... ;-)
Comment #5
StevenWill commentedI also second the request to be able to disable OG breadcrumbs.
Comment #6
coastwise commentedAgreed, they should be optional.
subscribing
Comment #7
erykmynn commentedAgreed, OG breadcrumbs are unhelpful. You should be able to turn them off!
Comment #8
erykmynn commentedHere are two patches for OG 6.x-2
one adds a radio buttons for controlling breadcrumbs.
(in og/includes/og.admin.inc)
the other checks that setting and does or doesn't override drupals normal breadcrumbs
(in og/og.module)
rather simple really, and IMO an option that should be rolled in OG. The OG breadcrumbs just get in the way if you're expecting to use Menu Breadcrumbs or the Navigation menu as breadcrumbs.
Please let me know if there is any difficulties with my patches, I know PHP but haven't done a lot of group development.
How do we move towards committing this to OG?
Comment #9
erykmynn commentedUpdating status... Think this should be considered seriously by OG powers that be. Can "assign" to me if further work is needed, but I think this is a full implementation of the requested feature.
Comment #10
coastwise commentedPreliminary testing looks good, thanks a lot for this!
I'll update if I see any undesired behaviour.
Comment #11
tronathan commentedIf you don't want to hack OG, you can override this in the theme layer by adding the following to your template.php file:
This will override the breadcrumb that is passed into the theme function and use drupal menu system's breadcrumb instead.
Comment #12
erykmynn commentedyes, but philosophically it seems silly to have OG overwrite Drupals breadcrumbs only to have your template write drupals breadcrumbs back in when you could just cut it back a step by not having OG carry out that behavior (since it's apparently sub-ideal for so many people)
Comment #13
erykmynn commentedI'm not sure exactly what to set the status to, but it would be great if we could get some sort of reply from one of the project maintainers. A lot of people seconded the request for this feature and it seems to be a tiny and sensible change.
Comment #14
moshe weitzman commentedLooks good. Could you please change all these drupal_set_breadcrumb() calls to og_set_breadcrumb() calls and then put this check in one place.
Please see diff and patch page for instructions on creating a patch. One patch can span multiple files. If you just can't get that working, attach two patch files to the issue instead of one zip file. This makes it easier to review.
Also, if (variable_get('', 0)) is enough. Not need for the == 0 part.
Thanks for the patch.
Comment #15
erykmynn commentedExcellent tips! I'm sort of new to patching, so I hope this worked. I assume it is most appropriate to patch the DEV version, but since I started on the stable (or someone might want to use it) I've included that too.
Since I'm not 100% sure that I did a "multiple file patch" correctly, let me know if you have trouble with it. I can provide separate patches.
also with the variable_get, i changed to if(!variable_get(",0)) since I want to act on the state of 0 and not 1 (which PHP assumes 1 is true and 0 is false).
Thanks, Eric
Comment #16
datune commentedSeems to work as expected, I have tried patching both the dev and stable one. Thanks a lot, this is exactly how it should work. This should go into OG Core ;-)
Comment #17
erykmynn commentedthanks for testing datune...
is this the correct status to get a maintainers attention again?
Comment #18
crea commentedSubscribing
Comment #19
erykmynn commentedchanged version status as there was a dev patch dated October 2nd.
Comment #20
servantleader commented+1
Thanks for the patch. I hope the maintainers fix this soon.
Comment #21
amitaibuOnly first letter should be capital.
Also there an extra space there.
Do we really need to unset the options?
Please add PHPDocs in the form of
Please fix tabs
Also it would be nice to have a simpletest to check the breadcrumbs option.
I'm on crack. Are you, too?
Comment #22
erykmynn commentedI see. I didn't know anything about coding standards then, and I've cleaned up some of the mess.
Also it struck me there was an even more efficient way to handle this. Instead of adding another function and multiple calls to it, I have merely included the logic in the exisiting og_get_breadcrumbs function instead.
I've incuded a stable and dev version of the patch
Comment #23
amitaibuWords should start with a Capital letter. In this case it should be OG or Drupal ... Line should add it a dot. Also you have empty spaces all over, please remove them.
I think the description should be something like "Use Organic groups custom breadcrumbs."
Should be:
}
else {
btw, you need to roll only against DEV. Thank you for the work...
Powered by Dreditor.
Comment #24
tallsimon commentedthis looks promising indeed, please do keep going... would love to see in dev soon!
thank you
Comment #25
mrtorrent commentedsubscribe
Comment #26
wfx commentedsubscribe
Comment #27
wizonesolutionsAnticipating this one as well myself. OG's a module I don't really want to break on upgrades so I'll just use the theme layer workaround for now...
Comment #28
thepanz commentedThis is my patch against 2.x-dev
Comment #29
thepanz commentedAs no review received: my patch adds the ability to configure the OG Breadcrumb visibility: you can choose to turn them off or not (default: on).
Patch also includes the uninstall cleanup for the setting.
Comment #30
tallsimon commentedgreat thanks
Comment #31
amitaibu@thePanz,
Thanks for the patch, but please don't chane the status to RTBC on your own patch. Haven't got much time to review it before OG7 is out, but maybe others will.
Comment #32
thepanz commented@Amitaibu: sorry for that! I didn't mean to change the issue status, but add more details about my patch.
Regards
Comment #33
wilco commentedIn case you all need this, here is a patch against 2.1 of the module. I hope this helps all those out there, with the same issue, as much as it did for me.
Thanks thePanz!
Comment #34
wilco commentedIn case you all need this, here is a patch against 2.1 of the module. I hope this helps all those out there, with the same issue, as much as it did for me.
Thanks thePanz!
Comment #35
thepanz commentedI've forked Amitaibu OG module from github and I've merged 2.x branch with this patch on commit https://github.com/thePanz/og/commit/86787a87697259bae5b5138f5437171016c...
Amitaibu : you can merge my edits with the default OG code (or cherry-pick the right code commit)
Comment #36
acbramley commentedI've just run into a problem with the patch in #22. This is quite an edge case but if it happens that the user has selected for og not to set breadcrumbs, in og_get_breadcrumb you have not said to return anything it's just drupal_get_breadcrumb(). This falls down when og_view_group calls that breadcrumb function and does an array_pop on it. You get the error
This patch fixes that, and also removes the t() functions from inside the l() which do not need to be there (Check the API page for l). There's also a couple of minor layout changes.
Comment #37
acbramley commentedAnd here's the same patch for 6.x-2.1
Comment #38
ice5nake commentedWould love to see this in a new version of OG.
Comment #39
ice5nake commented@Zombienaute, Thanks. Your patch worked for me.
This is a great feature. Hopefully they will get this into 2.2 if we ever get it.
Comment #40
Grayside commentedl() does indeed need t().
Comment #41
donquixote commentedOG support for both branches is in the pipeline for Crumbs.
This does include disabling some of the og-based breadcrumb logic.
I need some help from og experts to review the recent work:
#1819300: Support both branches of Organic Groups: 7.x-1.x and 7.x-2.x
Comment #42
Grayside commented@donquixote, this issue is OG6-specific. Not likely to find many OG7 folks wandering up and down these shadowed halls.
Comment #43
claudiu.cristeaThis version of Drupal is not supported anymore. If this is still an issue in the
8.x-1.xbranch, please open a new up-to-date ticket. Closing.