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.
Requirements ¶
- Yii 1.1 or above (built and tested on 1.1.12)
Installation ¶
1. Download EChirp or Clone the files
2. Extract into extensions folder
Usage ¶
$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>'
}
How to pass the template
I am stuck on how to pass the template json to this extension. How should this be done?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.