[support] Login Destination
William Smith
william.darren at gmail.com
Mon Sep 14 00:54:27 UTC 2009
Ah, I see. Ok, well the groups that a user is joined to is contained within
the user object. So if you can feed Login Destination PHP code snippets,
you would want something like
global $user;
if (isset($user->og_groups)) {
return $user->og_groups[0];
}
A couple of caveats:
- you'll need to double check the actual name of the og_groups property. I
*think* off the top of my head it is 'og_groups', but I'm not 100% sure.
- this assumes that Login Destination runs its code after the global $user
object has been set
- organic groups often uses the group id (gid) as its array keys, so
og_groups[0] might not work. Since you know in advance that a user can only
be a member of one group on your site, you could also use "return
array_pop($user->og_groups);"
Please let me know if that works. If not, I'll gladly help to tweak it.
On Sun, Sep 13, 2009 at 8:07 PM, A-NO-NE Music <madflute at anonemusic.com>wrote:
>
> Thank you for your response.
>
> Not og/my. It's the group home page you created when you add a new group
> as a Content Type. In other words, there is only one node to that group,
> which content type is OG, and this node becomes the home page where all the
> private node will be added there by "Promote to Front". og/my only shows
> the title in a table view, and it doesn't look good as the home page to the
> group. I understand it is this way since one might belong to multiple
> groups in a usual Drupal use, but for my needs one only can join one group.
> This is why I want to show the group home page contents when one logged in.
>
> Sorry English is not my forte :-)
> --
> - Hiro
>
> Hiroaki Honshuku, A-NO-NE Music, Greater Boston
> http://a-no-ne.com http://anonemusic.com
>
>
> On 2009/09/13, at 14:36, William Smith wrote:
>
> Which page do you mean by "OG home page"? og/my?
>
> On Sat, Sep 12, 2009 at 3:24 PM, A-NO-NE Music <madflute at anonemusic.com>wrote:
>
>>
>> Drupal 6.13
>>
>> How can I make it so OG member is sent to their OG home page using Login
>> Destination? I am assuming you need to put some PHP code, but google
>> doesn't return much help especially on Drupal 6.
>> Appreciate any help.
>>
>>
>> --
>> - Hiro
>>
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090913/efc2aeee/attachment.htm>
More information about the support
mailing list