i have been looking for an answer like a mad man....any help will be appreciated =)

i have created a content type using cck and set that as a group node.

in that content type, i have
1.Title stays as Title
2. Body set as the group's mission statement
3. imagefield where users can upload an image as the group's avatar
4. taxonomy field where users should select a type for the group they are creating

Everything works fine till now and i created a test group and posted few messages as a user to the group.

Now when I go to the group's home page, I will get:

1. group's name (title)
2. group's mission statement (Body)
3. user submitted contents (events, discussions, messages etc)
4. group avatar (imagefield)
5. group type (taxonomy)

I want to have the group avatar and group type to come above the mission statement at the top of the page but have no idea how to do it. when i look in to the node-og-group.tpl.php file which comes with organic group, it looks like all 1, 2, 3, 4, 5 comes from $content and i am guessing that i need to find this $content, somehow use it to create a template.php file and redefine the function phptemplate_, then rearrange the items... ( i hope you can understand what i mean...)

if what i am guessing is correct, i need to know where to find this $content thing....

$content appears several times in the og folders and i am not sure which one should be used...should i look for one that is 'connected' to "theme_" or that doesnt matter? what about those preprocess functions?

i tried also rearraging the page by manipulating the og_ghp_ron node view with no luck at all... i am also wondering if i should do this using panels...

phptemplate, view and panel...which one is the best way to go?

please let me know what you guys think...

thank you.

Comments

tallsimon’s picture

Very good question and a beginner's guide is lacking for Drupal 6. I can only answer some of this as I am still working out how to do it myself. There are two approaches to group home pages, depending on what is required:

Complex group home layouts including blocks, nodes, views etc:
- OG Panels is not yet working for OG as far as I know
- Composite Layout has some of the functionality of Panels, in theory you could create mini panels containing views which become blocks and can then be displayed through composide layout (complex!)

Rearranging content:
- CSS will get you so far
- Contemplate is one way to rearrange the content of nodes (presumes knowledge of templating, especially useful for CCK fields)
- Altering templates directly is the other option- copy [sites/all/modules/og/node-og-group.tpl.php] and others into your theme folder and edit them. These templates come with documentation:

* Og has not modified this at all. It is same as node.tpl.php.
 * This template is used by default for group nodes.
 *
 * Theme implementation to display a node.
 *
 * Available variables:
 * - $title: the (sanitized) title of the node.
 * - $content: Node body or teaser depending on $teaser flag.
 * - $picture: The authors picture of the node output from
 *   theme_user_picture().
 * - $date: Formatted creation date (use $created to reformat with
 *   format_date()).
 * - $links: Themed links like "Read more", "Add new comment", etc. output
 *   from theme_links().
 * - $name: Themed username of node author output from theme_user().
 * - $node_url: Direct url of the current node.
 * - $terms: the themed list of taxonomy term links output from theme_links().
 * - $submitted: themed submission information output from
 *   theme_node_submitted().
 *
 * Other variables:
 * - $node: Full node object. Contains data that may not be safe.
 * - $type: Node type, i.e. story, page, blog, etc.
 * - $comment_count: Number of comments attached to the node.
 * - $uid: User ID of the node author.
 * - $created: Time the node was published formatted in Unix timestamp.
 * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
 *   teaser listings.
 * - $id: Position of the node. Increments each time it's output.
 *
 * Node status variables:
 * - $teaser: Flag for the teaser state.
 * - $page: Flag for the full page state.
 * - $promote: Flag for front page promotion state.
 * - $sticky: Flags for sticky post setting.
 * - $status: Flag for published status.
 * - $comment: State of comment settings for the node.
 * - $readmore: Flags true if the teaser content of the node cannot hold the
 *   main body content.
 * - $is_front: Flags true when presented in the front page.
 * - $logged_in: Flags true when the current user is a logged-in member.
 * - $is_admin: Flags true when the current user is an administrator.
 *
 * @see template_preprocess()
 * @see template_preprocess_node()
 */

So it looks like you use a combination of CSS classes and PHPTemplate variables (above), e.g.

  <?php if ($terms): ?>
    <div class="terms terms-inline"><?php print $terms ?></div>
  <?php endif;?>

Let me know how you get on, or post a snippet here! Cheers.

tallsimon’s picture

arski’s picture

Hi, this works great.

One question though: is it possible to add some preprocessing to this template as well? like a function called template_preprocess_node_og_group().. I assume this should be possible somehow as it is for every other theming function, I'm just not sure where to add/define it.

Thanks in advance!

Martin

moshe weitzman’s picture

Status: Active » Fixed

You can add a preprocess function in a custom module (or in your theme's template.php file). It would be called MODULE_preprocess_node() where MODULE gets replaced by your module name. For an example, see theme.inc's template_preprocess_node. Also see the theme-guide linked above. Look for preprocessors section.

tallsimon’s picture

@moshe - thanks
@arski - any luck with this? can you show off what you have so far? i'm still looking at other ways to do this

Status: Fixed » Closed (fixed)

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

arski’s picture

hey, i've used that node-og-group.tpl.php and added some preprocessing using this guide: http://drupal.org/node/337022
Pretty easy and powerful, although I'm thinking of writing my own OG plugin or whatever, as I have more blocks etc. with a lot of preprocessing that I want to integrate with this..