I'd like to display block if, and only if node that is displayed belongs to some group. When I'm using og_get_group_context it works perfectly with exception of the event, when I use permalink to comment, that is added to node belonging to some group. In this case there is no og group context set and block is not displayed anymore. (i.e. /node/11 shows block but /comment/1155#comment-1155 that displays this node also: doesn't)

Could You please give me any advice?

I'm using og 2.0 and permalink 6.x-1.6 , drupal 6.14

Comments

Tarsjusz’s picture

I've changed in function http://drupalcontrib.org/api/function/og_determine_context/6

line

elseif ($path == 'comment/edit' || $path == 'comment/delete') {

into

elseif ($path == 'comment/edit' || $path == 'comment/delete' || $path == 'comment') {

What is the reason it is not in this shape oryginally?

Tarsjusz’s picture

Noone is saying anything :-)
However, I was testing my solution for some time now and it seems to be ok.
To give more explanation:

This is normal node in some og:
http://tarsjusz.pl/post/anonimowosc-komentarzy
Block on the top displays name of the group (Uniwersytet Warszawski)

Permalink to comment on this page is:
http://tarsjusz.pl/comment/610#comment-610
Without changes mentioned above block with group name is not displayed.

I'm not feeling like og hacker so I'd feel much more comfortable if someone would say, that adding this || $path == 'comment' is really not destroying something.