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
Hiroaki Honshuku, A-NO-NE Music, Greater Boston http://a-no-ne.com http://anonemusic.com
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@anonemusic.comwrote:
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
Hiroaki Honshuku, A-NO-NE Music, Greater Boston http://a-no-ne.com http://anonemusic.com
-- [ Drupal support list | http://lists.drupal.org/ ]
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@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
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@anonemusic.comwrote:
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@anonemusic.comwrote:
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/ ]
I would think you could do this with views. Make a view that displays the content you want with the argument (Organic groups: Member of a group) and then use this as the path for login destination module. I think this will work.
Thanks,
Steve
Steve Kessler
Denver DataMan
303-587-4428
Sign http://www.denverdataman.com/content/enewsletter-signup up for the Denver DataMan Free eNewsletter
From: William Smith [mailto:william.darren@gmail.com] Sent: Sunday, September 13, 2009 6:54 PM To: support@drupal.org Subject: Re: [support] Login Destination
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@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@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/ ]
Thank you so much. I have tried several different ways but I am just getting empty page (or 404 if I chose so).
I am getting really confused on this. I thought og_ghp_ron would help me understand how argument works but it even doesn't seems to be working the way I expected. On the other hand, "group/%/content" will brings My Unread up, while just mysite.com/group does the same. I don't understand why.
I think I am missing something big between path and argument.
-- - Hiro
Hiroaki Honshuku, A-NO-NE Music, Greater Boston http://a-no-ne.com http://anonemusic.com
On 2009/09/13, at 22:48, Steve Kessler wrote:
I would think you could do this with views. Make a view that displays the content you want with the argument (Organic groups: Member of a group) and then use this as the path for login destination module. I think this will work.
Thanks, Steve
Steve Kessler
Thank you so much. I forgot to tell you English is not the only problem I have. I have been wanting to learn PHP but haven't gotten that far yet. I am just a musician :-(
I tried your suggestion, which brings user to their profile page instead. I then tried with array pop method which returned an error message: "warning: urldecode() expects parameter 1 to be string, array given in mysite.com/includes/common.inc on line 308."
According to googling, og_groups seems to be the correct property, however.
-- - Hiro
Hiroaki Honshuku, A-NO-NE Music, Greater Boston http://a-no-ne.com http://anonemusic.com
On 2009/09/13, at 20:54, William Smith wrote:
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@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
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@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
Quoting A-NO-NE Music madflute@anonemusic.com:
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.
Have you looked at http://drupal.org/project/logintoboggan module?
-- Earnie -- http://r-feed.com/ -- http://for-my-kids.com/ -- http://www.4offer.biz/ -- http://give-me-an-offer.com/
On 2009/09/14, at 9:55, Earnie Boyd wrote:
Have you looked at http://drupal.org/project/logintoboggan module?
Thank you for your suggestion, Earnie. I just installed the module to check it out. It doesn't seems to have redirect per OG. It only has redirect per UID.
Back to Views2, setting the UID as the argument at login seems to be easy - my impression is that Drupal automatically fetch UID with % - but I just can't figure out the relationship between path, argument, and GID, especially I don't know how to fetch GID, and how to put that into the argument.
-- - Hiro
Hiroaki Honshuku, A-NO-NE Music, Greater Boston http://a-no-ne.com http://anonemusic.com