EChirp is a yii widget wrapping for Chirp.js.
Chirp.js is a lightweight templating JavaScript library that enables you to display tweets on your website. Client-side caching is available; and you can set if you’d like to show retweets and replies, too.
1. Download EChirp or Clone the files 2. Extract into extensions folder
$this->widget('ext.echirp.EChirp',array('options'=>array('user'=>'nucreativa','max'=>10,'target'=>'tweet')));
List options : - user — string Twitter username - max — number The maximum number of tweets to show - count — number The maximum number of tweets to retrieve - retweets — true|false Show or don't show retweets - replies — true|false Show or don't show at-replies - cacheExpire — number Number of milliseconds to cache tweets (localstorage on the client). - list — string Name of the list from the user to pull tweets from - target — string Id of a target DOM object you'd like the tweets to get added to. - success — function(json) A callback function called when tweets are successfully retrieved. The json data is the argument. - error — function A callback function called when tweet retrieval errors. - templates — json object A json collection with both the base and tweet templates. Example:
templates: { base:'<ul class="chirp">{{tweets}}</ul>', tweet: '<li><img src="{{user.profile_image_url}}"> {{html}}</li>' }
Total 1 comment
I am stuck on how to pass the template json to this extension. How should this be done?
Leave a comment
Please login to leave your comment.