Active
Project:
Janrain Social Login
Version:
7.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 May 2011 at 23:45 UTC
Updated:
20 Oct 2011 at 13:07 UTC
Is it possible and how using display suite, panels or custom php etc? I love the functionality but I would like to place it in a mini panel most specifically.
thx
Comments
Comment #1
geokat commentedYes, it should be possible. You can paste Javascript for the embedded
Sign-In Widget to a node and do with it however you please.
Cheers,
George
Comment #2
7wonders commentedBeen having a little play around with this but im definitely no php guy. Anyways, I got the button to show up in a mini panel by simply pasting the _rpx_share_button function in a custom php content and it shows the button but doesnt register the node title properly (the mini panel is within a node panel). I tried passing the node being viewed context but still nothing for the node title. Any ideas? Heres the function i pasted in custom php content pane:
Comment #3
BenK commentedGeorge,
I've received a few requests for this from people at Drupal Users' Group meetings. In particular, people want to be able to use the "Share" button in a Panel (http://drupal.org/project/panels).
I'm wondering if we can create a simple API that allows anyone to print the share button with a line or two of code. That would also solve the issue having the node context available.
Thoughts?
--Ben
Comment #4
BenK commentedComment #5
rafamd commentedTitle adjustment, feel free to revert but I guess we are talking about the button.
Comment #6
geokat commentedComment #7
7wonders commentedThis works with the details of the node. Use by pasting into a custom content pane or mini panel :)
Comment #8
funana commented+1
Comment #9
BenK commentedBumping this so that we can take a closer look.... George, what do you think about a simple API to do what is done in comment #7?
--Ben
Comment #10
BenK commentedTried out the code in #7 in a custom content panel, but I'm getting the following notice:
Notice: Undefined variable: user in eval() (line 11 of /Users/benkaplan/git/drupaldev/modules/php/php.module(74) : eval()'d code).
The share button is showing up (and the hover functions properly), but upon clicking nothing happens.
If we need to update the code for the latest 7.x-2.x-dev commits, we should do so and then document this.
--Ben
Comment #11
geokat commentedHey Ben,
I haven't checked this but judging from the error message, it seems
that you need to throw in a "global $user;" statement in that PHP snippet.
Hope this helps,
George
Comment #12
BenK commentedYeah, "global $user;" got rid of the notices. Thanks. Unfortunately, the share button still isn't clickable and doesn't launch the widget if you try to click.
Other ideas?
--Ben
Comment #13
geokat commentedHey Ben,
I've just tried creating a panel with the above code in it. It seems
to work - the widget is displayed when I click the buttons.
Cheers,
George
Comment #14
BenK commentedHmmm... I'll try again.
--Ben
Comment #15
BenK commentedHey George,
I tried that code again and for some reason it's working now! :-) Cool.
--Ben
Comment #16
rafamd commentedThat's very good news Ben, we didn't get to this yet in our implementation, but we certainly will. Should we call this fixed or are we providing some sort of API as you suggested in #9 ?
Comment #17
BenK commented@rafamd: The code is kind of a workaround for now. An actual API (or even just a block) would be much, much better. So this issue should be left active until it can be properly addressed in a future release.
--Ben
Comment #18
silkogelman commentedAs a temporary solution I wrapped #7 plus #11 in a module so people can use the Social Sharing widget as a Drupal Block.
Have a look:
http://drupal.org/sandbox/s1l/1315560
It would be great if there was a clean API for the Social Sharing widget (and the Social Login icons), (+blocks) and all of these features would be integrated in the Janrain Engage module.