By somebodysysop on
I have og, og_forum, views and category modules installed. I wish to replace the individual group home pages with Views (or, a view that will take the group node id as an argument).
The blub I found here http://drupal.org/node/59846 seems to indicate it's possible, but does not point to how it might be done.
Anyone done this? Have any ideas how to do it?
Thanks!
-ron
Comments
Replace Group Home Page with View (HowTo)
The og function that creates the default group home page is
and, it is themeable. You can replace this part of the function:
with the code to call a view:
That will do it.
My issue is that once you are looking at content from the view, you lose the og group navigation menu. So, my new question is: is there a way to tell og that when you are in a particular view (like, view/group/groupNumber), that you are still in group content and to maintain the group navigation menu?
Thanks!
Excellent Question
Depending on the URL I would 'think' it's possible to call a group menu (specific group menu).
Maintaining Group Context - Found the solution
What I really wanted to do was maintain my group context while in the view. I found a way to do it with the og_tracker contribution discussed here: http://drupal.org/node/66145
How about this
I just had to tackle the same issue and simply put this bit of code as Argument Handling Code into the view:
The only argument of the view is the node id of the group you're looking at. The group block shows up when viewing the page. But I haven't tested it much. Does anyone have experience with that?
Here's the rest of the view:
content_group_discussion is a cck content type similar to the build in blog content type.
Thanks MarkusH!
I had the same problem - I want to have the group blocks available on my view pages. That node_load and og_set_group_context in the argument handler worked beautifully!
Thanks again.
Thanks for posting this,
Thanks for posting this, SomebodySysop.
Can you help me with regards to the code above? I have a view called group_home and the url
networking_group/$argwhere the arg is the og nid. So, to get that to appear in place of the default group home page, what exactly do I replace the code with? I have tried this, but it doesn't seem to work:Regards
Patrick
It's been a while, but here is what I used...
I haven't looked at this in quite a while, but I went to my template.php file and pulled this out of my theme_og_view() function.
So, it looks like you should try using $node->nid.
If this doesn't solve it, then I'll post the whole function.
Thanks SomebodySysop, Would
Thanks SomebodySysop,
Would you mind posting the whole function? I'm not a 100% clear on what to name the function in template.php and I don't want to get this wrong!
Sorry to be a pain.
Regards
Patrick Nelson
www.vcommunity.org.uk
I'm using channel_nine theme, so in my template.php
I'm using channel_nine theme, so in my template.php here is the code I use:
Export Group View
Hi, could someone please export their group views settings? (or send detailed instructions of how to create it)
thanks
/petter
Just to help out, here's mines...
Please note that this particular view has a lot of embedded views in it (which I expunged from the header below to avoid posting errors here). Also, I'm doing some fancy filtering with categories. But, with the theme_og_view() code above, this is what I use as my group home page: