Insert twitter, googleplusone and facebook button, accepting horizontal and vertical alignment.
Extension's code is XHTML valid.
Requirements ¶
Tested with Yii 1.1.7
Install ¶
- Download the latest release package
- Unpack it in /protected/extensions/ folder
Usage ¶
Insert next code in your page, where do you want to place buttons.
<?php $this->widget('application.extensions.social.social', array(
'style'=>'vertical',
'networks' => array(
'twitter'=>array(
'data-via'=>'', //http://twitter.com/#!/YourPageAccount if exists else leave empty
),
'googleplusone'=>array(
"size"=>"medium",
"annotation"=>"bubble",
),
'facebook'=>array(
'href'=>'https://www.facebook.com/your_facebook_page',//asociate your page http://www.facebook.com/page
'action'=>'recommend',//recommend, like
'colorscheme'=>'light',
'width'=>'120px',
)
)
));?>
Usual parameters to be adjusted: ¶
- style: button's alignment (string: horizontal or vertical).
- networks: social network which you must have (twitter, googleplusone, facebook);
- data-via:Your Twitter Page Account if exists or leave empty (url: //http://twitter.com/#!/YourPageAccount)
- size: google button size (string:small, standard, **medium**, tall)
- annotation: google button mode to show annotation(string: **bubble**, inline, none)
- href: Your Facebook Page (url: http://www.facebook.com/facebook_page)
- action: action for facebook button (string: **recommend** or like)
- colorscheme: used color scheme for facebook button (string: **light** or dark)
- width: the width for facebook button container (pixels: **120px**)
:D
Very Good!
Good work.
Very easy to use. Just a minor problem: multiple G+ buttons on the same page are not displayed.
Awesome
absolutely awesome job done here.
Works great!
Very good extension works right out of the box.
I did made some changes ;-)
"<?=" has been replaced with "<?php echo" in the views. There is always that one host that doesn't support short tags. (mine)
In the init() function it looks like you are making calls to abstract functions "self::" instead of "$this->" have no idea why this is?
I made the widget extend from CWidget instead of CInputWidget
Added a public property $htmlOptions and changed last line social->renderSocial()
from
echo $this->render('social', array('rendered'=>$rendered));
to
$this->htmlOptions['id']=$this->getId(); echo CHtml::tag('div', $this->htmlOptions, $rendered);
Where can I download the extension from?
Thanks very much!
@MichelH
<?= works even with short tags off. I got suprised when I noticed, but its true:)
(I have short tags off on my localhost and use <?= all the time )
Demo site: Using it on Geogram.co Place Pages
You may need to join to see the live demo:
http://geogram.co/phinney-ridge
Screenshot here:
http://screencast.com/t/CfngX9i7ij
Request for features
Great work on this.
Is it possible to have facebook recommend a regular url on the internet vs. a facebook.com/page?
Is it possible to pre-load text & url to twitter as opposed to their default scraped info?
Cant get this extention to work
Hi, just tryied your extention, but i can only display google and twitter and only in vertical, can't get facebook to work, any ideas ?
@ptv1p3r
facebook will work only if your data-href url exists and is a real one, not a local one.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.