Widget that generates sharing buttons for facebook, twitter and google plus
Yii 1.1 or above
Copy files to your project, eg. to protected/components/widgets. You should preserve the folder structure and make sure assets are placed in ./assets/socialshare. You may place assets to another directory, but make sure you specify the full path in 'assetsPath' property.
$this->widget('path.to.SocialShareWidget', array( 'url' => 'http://example.org', //required 'services' => array('google', 'twitter'), //optional 'htmlOptions' => array('class' => 'someClass'), //optional 'popup' => false, //optional ));
Total 5 comments
i tried creating a folder under components and calling it widgets, but when i try to link to it i get the following error ; "alias is invalid" any idea ?
You probably have a typo. Judging from the error message, I would guess that your 'services' config line actually reads:
(note the extra comma).
@sanguina
Here's a website that uses this widget:
http://www.popboks.com/article/9208
Scroll down until you spot social sharing icons (facebook, twitter, google).
This works well with g+ and twitter but does not work with facebook, at least for me with these settings:
error:
Thanks for the extension - a demo page would have been really nice :)
Leave a comment
Please login to leave your comment.