Using JavaScript to add your Twitter timeline to a Cotonti-powered website is an easy and simple job even for a HTML rookie. The whole thing will take you around 15 minutes and will require nothing more than some simple operations with you theme/skin.
First off, we need to:
For the testing purposes I chose TwitterJS:
<script src="http://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js" type="text/javascript"></script>
This string shall be added to the header.tpl within the head block.
Basically, there are 2 parameters: twits div ID and the output settings:
getTwitters('myTwits', {
id: 'cotonti',
count: 5,
clearContents: true,
enableLinks: true,
ignoreReplies: false,
withFriends: false,
template: '%text%',
prefix: '',
timeout: '10',
onTimeout: '',
onTimeoutCancel: false,
newwindow: false,
callback: ''
});
Brief explanation of the settings:
Template variables shall be wrapped in %'s. These are pretty much self-explanatory:
This should look like:
<div id="myTwits">
<p>Loading twits <img src="./skins/{PHP.skin}/images/indicator.gif" /></p>
<p>Use <a href="http://twitter.com/cotonti">this link</a> to read my twits</p>
</div>
Unless you used the template setting, the output HTML-code should be:
<div id="myTwits"> <ul> <li> <span class="twitterPrefix">I said: </span> <span class="twitterStatus">Join up with our discussions at cotonti.com!</span> <span class="twitterTime">20 minutes ago</span> </li> ... </ul> </div>
Use this pattern to define styles for your Twitter timeline.
223 mal
Добавляем твиты на сайт под управлением Котонти
76 mal
Or you can use my free twitter plugin http://littledev.ru/news/cotonti/cotontifolio/twitter-bot.html
Tottaly customizible templates + auto add twits on new pages