Insert twitter, googleplusone and facebook button, accepting horizontal and vertical alignment.
Extension's code is XHTML valid.
Tested with Yii 1.1.7
Insert next code in your page, where do you want to place buttons.
$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', ) ) ));
- 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**)
Total 6 comments
<?= 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 )
Thanks very much!
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
to
absolutely awesome job done here.
Very easy to use. Just a minor problem: multiple G+ buttons on the same page are not displayed.
Very Good!
Leave a comment
Please login to leave your comment.