I'm trying to figure out how to change the appearance of the "groups" page that the Organic Groups module (OG) creates.

For now, I'd like to be able to show, using the river-of-news, only group-targeted book pages that are "sticky". Or even just group-targeted nodes of any sort that are "sticky". From looking at the OG code and documentation, it seems that I need to redefine this function in my phptemplate-based theme:

// if you want a totally different group home page, you may redefine this function in your theme
function theme_og_view(&$node, $teaser = FALSE, $page = FALSE) 

It looks as though I could use the call to this function to only return book pages:

// str_types is a list of types which should be selected. if not provided, we return all og nodes
// filtering for a given gid is done by passign a a special $arg to db_rewrite_sql()
function og_get_home_nodes_sql($str_types = NULL)

So, assuming my theme is named "column", my understanding is that I define a function named column_og_view() in my theme's template.php file? Or, do I need to name it: phptemplate_og_view() ? In this function, I can reproduce the code from theme_og_view() as a start, but do I need to use an include() statement or something else to access the og_get_home_nodes_sql() function or other functions in the OG module?

In an ideal world, I'd like to be able to set the group page appearance on a per-group basis (maybe this needs to be an OG feature request). I like to have a root-level book page as the group page for some groups, and a river of news for other groups.

Comments

Shane Birley’s picture

...spending some time this week working on this exact problem. Are you working on 4.6 or 4.7?

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

pwolanin’s picture

This is for drupal 4.7-cvs.

---
Work: BioRAFT

moshe weitzman’s picture

My intent is that Views module provides default group home page and directory of groups page. Views i already integrated in the HEAD version of og. Just need a little more to get rid of current og group home page. With 4.6, you pretty much have to use themeing to redo this home page

pwolanin’s picture

That sounds good- I'll be a little patient and not try anything too ambitious.

Also, this sounds like it will become irrelevent, but in playing with the current (4.7cvs) version of OG, I've noticed that setting the number of posts on the group page to 1 or 0 results in some problems. With 1 it seems a bunch of empty pages appear following the available content, and if it's set to 0 an error is returned from the pager function.

---
Work: BioRAFT

Shane Birley’s picture

...not all that well documented - unless I am I daft and missing something? What would make life easier for OG 4.6 theming is if there were more blocks to play with. The OG blocks contrib is the right path, but only has two blocks in it.

I was going to spend some time this week putting some 4.6 OG snippets together (which is difficult with the extra group ownership) for theming - but if there is another way, any widom would be most appreciated. I really want to "give back" on this for 4.6 but without adequate documents to follow from... perhaps I am just too dumb.

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com