Need Help Customising OG Group Homepage's

parry.luke - February 17, 2007 - 15:37

I have been looking for about three hours, trying different stuff people have suggested to try and alter group homepages, all of theme have failed, and seemed to not have worked for other people.

I am not an expert to the drupal api, but could anyone help explain fully how I would change the groups homepage completly. For instance just having a blank page with a bit of text on?

Using Views isn't useful, and therefore I am resorting to the need to override it.

Would it require code in the template.php or something else?

Huge thanks for your assistance

Luke Parry

new view

pwolanin - February 17, 2007 - 16:39

I'm not an expert in Views, but I'd think it should be easy to create a "blank" view.

In the OG setting you'd then have the option to use that view instead.

Here's what I just tried (a little hackish):

Go to the Views UI page: /admin/build/views

Import the following:

  $view = new stdClass();
  $view->name = 'og_ghp_blank';
  $view->description = 'OG: Group home page - blank';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->sort = array (
  );
  $view->argument = array (
  );
  $view->field = array (
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'moderate',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node);
  $views[$view->name] = $view;

Then got to /admin/og/og and set this view to be the default for the group home page.

If you are on Drupal 5.x, and not using a moderation module, there will be zero nodes in moderation queue, and thus this returns an empty list...

that works what you have

parry.luke - February 17, 2007 - 16:57

that works what you have given me. I just now have to find out how I can override this in the template.php

Thanks for your help!

how to create a view to show "Group by content type" home page?

enky - February 17, 2007 - 17:31

hi,

how to create a view to show "Group by content type" presentation style?
i.e. to show teasers grouped by content types, unlike the default river of news style?

thanks,
enky

Having spent wasting another

parry.luke - February 17, 2007 - 17:31

Having spent wasting another hour, after getting that blank page up, I still cannot actually create a custom page. I just simply want to place some php code onto the page. I have tried accessing the blank views page, but it just won't do anything.

How would I override this views page, in template.php?

thanks again for your help

Just need a template file

nevets - February 17, 2007 - 19:18

Lets start by assuming you are using the content type 'homepage' for your group home page. Go to your theme directory and copy node.tpl.php to node-homepage.tpl.php.

Edit node-homepage.tpl.php, from what you say you will want to start by removing/replacing the line that says print $content. If you need to know what is available for the node you can add

  <pre>
  <?php print print_r($node, TRUE); ?>
  </pre>

which will show you all the content available.

Og homepage template worked great!

lsabug - July 19, 2007 - 17:15

Thanks so much for the pointer here, I was scratching my head for a while but now the template theming makes more sense with your post and what a relief to be able to change the group homepage like this rather than with views.

Just in case anyone else wants to know how to display categories (category module) on the group home page add this to the template file:

<?php print $node->content['category_display_navigation']['#value'] ?>

And it really helps to have contemplate installed, it makes viewing available content types easier.

 
 

Drupal is a registered trademark of Dries Buytaert.