I've been working towards an OG home page that uses Panels 2, Views, and OG. I'm stuck on two items:

1) Subscriber Pictures: I would like show the subscriber pictures, similar to the blocks that come with OG, but smaller, tighter, and without the username displayed underneath. I've tried creating a new view but there seems to be no user pictures available through Views. The blocks that come with OG work fine but I can't customize them. Does anyone have any suggestions?

2) Group Details: I'd like to distribute the various links that show up in the "Group Details" block to their related panes. For instance, I have a pane that includes a panels view for Stories. I would like to include the "Create Story" link in the footer of that panels view. Also, I would like to include a Join Now link with the group description. It seems more appropriate to place things where they are most likely to be utilized. Give the fact that the links contain the GID (for example, /node/add/story?gids[]=37), is it possible to recreate them in a different area of the home page without destroying whatever argument they are currently using?

Any insights are greatly appreciated!

CommentFileSizeAuthor
#15 og_theme.patch3.56 KBjbrauer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

1) I think this is going to require some custom code. Not sure immediately about how best to do this.

2) I think you will have to contruct this link yourself. You can call og_get_group_context() in order to learn all about the current group. The 'nid' element is the one used at the end of those create links.

I'm curious about what you have working well and other stumbling blocks you have overcome. Are you using the new og_panels module?

WISEOZ’s picture

For 1 and 2, do you offer any paid services for this little things? I'm not a programmer (and just don't intend on ever being one).

The way I'm using OG, Panels, and Views together is with what you had outlined in the tutorial you recently posted. I stumbled on the first try because I ran into some PostgreSQL bugs with Panels Views. I had a friend of mine fix that and now I'm successfully creating OG home pages with nodes, views, and blocks in Panels.

So far, I have my node pane for the group description and I have a "Stories" and a "Forums" pane created from Views using the "OG: Group nid(s)" argument and passed through Panels Views to get it on the Panels page. I've also managed to add the OG Aggregator block without any trouble at all. I'll be working on a OG gallery next but using CCK, Taxonomy, Image, Imagecache, and Views (similar to what I've done with my user pages). There just doesn't seem to be good support for a gallery that allows for a single OG permissioned album (and the OG Gallery module looks a bit old and underwhelming).

Anyhow, I can certainly share more as I figure out what's what. I actually have my site launching on April 1st with over 100+ groups needed.

WISEOZ’s picture

I forgot to mention this find ... it might be worth something to someone ...

Panis has created an alternative module to the Avatar Gallery module at http://www.hyrme.com/node/17. It has not been posted to drupal.org (besides being mentioned as a potential patch for the original Avatar Gallery) but it does have support for OG and it does work. Once installed, you can get to the group specific user pictures at avatars/og/gid and there are several .css changes that can be made to make the user pictures smaller or remove the username (that's what I did at least). My only problem is I'm not adept enough at this programming stuff to figure out how to utilize the avatars/og/gid URL in the various OG home pages through panels.

Anyhow, just thought that may be of interest to someone.

WISEOZ’s picture

I figured both of these out and figured I'd post the solutions for others to use as they please.

For my OG Panels home page for a user pictures pane, I am using the Avatar Gallery 2 module (which is simply a patch that can be found in the Avatar Gallery module queue). If you use the Random Avatar or New Avatar block for your OG page, it will pick up the group argument and only show the user pictures for the current group. It comes in a grid layout and allows for some easy CSS modifications as well.

For my OG Panels home page for the group details links, I am using this snippet of code to create the appropriate links in my views footers:

<?php $group_node = og_set_group_context();?>

<a href="/node/add/story?gids[]=<?php echo $group_node->nid; ?>">Share a story</a>
sdboyer’s picture

Hi WISEOZ - I'd keep my eye on og_panels.module as moshe pointed out, which should be moving towards a stable version sometime in the near-ish future. It either does, or will, encompass most of the functionality you described in your OP:

1. This is actually one that's fairly high on my own priority list - ideally, you'll be able to add a pane that lists group members, and via the nice panels GUI, will be able to control things like - whether user names or pictures are used, or both; a size that images should be resized to (this is iffy, I'll figure out if this is feasible as I go); how many members should be displayed, etc.

2. This is a little tougher to facilitate via a GUI because of the way that block is constructed. Constructing the link yourself is the easiest way, as Moshe points out. However, as we get together more og-specific panel content, you'll be able to approximate this sort of goal more and more easily.

moshe weitzman’s picture

Title: OG/Panels/Views ... Subscriber Pictures & Group Details » Subscriber Pictures & Create link in OG Panels
Category: support » feature

1. Yes, this is crucial. Patches welcome.

2. I think we should make a content item called 'Create links' and in the options an admin can pick and choose which he wants in the list. A one item list would be a very valid use case.

The way to do the user picture resize is to have admin pick an imagecache preset that should be shown. See http://www.lullabot.com/articles/imagecache_example_user_profile_pictures and a module which purports to do same: http://drupal.org/project/imagecache_profiles. This is icing though. We need the basic content item urgently.

jbrauer’s picture

I'd been working on something similar. Where I was going was a patch that would turn og_user_title_list into a theme function thereby rendering it subject to being overridden. The issue I'm running into is wanting user pictures themed a particular way in the OG subscribers block and differently elsewhere and so as a start making the list function so that I could override it and then easily call an overridden theme_user_picture.

It seems it would be possible to then add an array element to the theme_og_title_list function that will take additional items an admin wants to render in the subscriber block.

Does that seem like a reasonable place to start?

moshe weitzman’s picture

I recently added a content item called Faces to og_panels which has a nice tight presentation of faces. You can customize the number of rows and columns. An example is at bottom of http://groups.drupal.org/drupal-dojo.

I'll leave this open for the create links.

sdboyer’s picture

Sorry Moshe, I totally missed your initial response to my post here last month. I really like that line-by-line content type idea - once I actually finish off this enormous overhaul of og_blueprints, I'll put some time in on that (and the other content types I've been talking about).

Mike Sances’s picture

Re: #8, is it possible to add the Faces content item to a Panels page? For example, I have one panels page set up to replace the default Groups home page. I'm trying to give every Group home page the Faces content item. It seems that right now I'd have to create a Faces panel for each group one by one.

droople’s picture

subscribe

Mike Sances’s picture

After looking at the og.module (line 956), I was able to achieve what I was looking for in #10 using a custom php snippet.

$gid = og_get_group_context()->nid;
echo og_list_users_faces_page($gid, $column_count = 5, $row_count = 10, $pager_id = 0);
Mike Sances’s picture

Re #3 above, the beta avatar 2 module generates an SQL error with the OG module. See http://drupal.org/node/272091.

iqbal.pakistan’s picture

This is very helpful for me.

jbrauer’s picture

Version: 5.x-5.4 » 5.x-7.1
FileSize
3.56 KB

This is not a fix to this issue per se. Rather it's a patch for how I accomplished this sort of thing. As this is handled by Views in the 6.x version of OG... This particular patch won't work for anybody else as it has some SQL related to my database but it may serve as a model if somebody need to have more flexibility. This patch replaces og_user_title_list($result, $gid = NULL, $show_more = TRUE, $show_picture = NULL) with theme_og_user_title_list($result, $gid = NULL, $show_more = TRUE, $show_picture = NULL) so it is then possible to re-theme the block in a function specific to the site.

I don't plan to re-work this into a more general solution unless there is further discussion here that it would be widely useful.

SocialNicheGuru’s picture

subscribing

chrispooh’s picture

subscribe