21474 Posts in 5781 Topics by 2620 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1161 Views |
-
[Solved] Twitter is non chronological

20 February 2011 at 3:22am Last edited: 20 February 2011 3:33am
When integrating the default twitter script on my page.ss
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
width: 200,
height: 300,
theme: {
shell: {
background: '#FFF',
color: '#666666'
},
tweets: {
background: '#FFFFFF',
color: '#666',
links: '#53A318'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'all',
}
}).render().setUser('mynamehere').start();
</script>I get them on my site, but the order is in reverse! The oldest is on top, and the most recent at the bottom.
How do i fix this?Does this have to do with SilverStripe templates? Because on the twitter website (where you generate the code) it does seem to work normal?
And when i test the script as a html file, it is in the right order: Recent on top, oldest at the bottom.
-
Re: [Solved] Twitter is non chronological

20 February 2011 at 8:12am
I use the twitter widget too and haven't had that problem.
You might want to integrate the javascript by a different method instead -use the <% require javascript %> tag and Requirements::customScript.
See: http://doc.silverstripe.org/sapphire/en/reference/requirements
-
Re: [Solved] Twitter is non chronological

20 February 2011 at 9:43am
Ryan, thx for your reply.
I've modified my template:
in the headtags:
<% require javascript(http://widgets.twimg.com/j/2/widget.js) %>
in the body:
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
width: 200,
height: 300,
theme: {
shell: {
background: '#FFF',
color: '#666666'
},
tweets: {
background: '#FFFFFF',
color: '#666',
links: '#53A318'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'all',
}
}).render().setUser('name').start();
</script>But still not in the right order.
Could you paste your code?
Im using SS 2.4.5 btw
-
Re: [Solved] Twitter is non chronological

22 February 2011 at 6:59am
Thanks to UncleCheese!
add this to your controller:
class TemplateName_Controller extends Page_Controller {
public function init() {
parent::init();
Requirements::block('sapphire/thirdparty/prototype/prototype.js');
}
}WORKS!
-
Re: [Solved] Twitter is non chronological

28 February 2011 at 7:00am
Which Module is? Is it go with 2.4.5?
-
Re: [Solved] Twitter is non chronological

1 March 2011 at 10:34am
i think it works for the twitter module aswell. I am using the standard script provided by the twitter website.
Runs well on SS 2.4.5 -
Re: [Solved] Twitter is non chronological

6 September 2011 at 11:16am
Lol.. I just had that on a site. blocking prototype sorted it.
| 1161 Views | ||
|
Page:
1
|
Go to Top |


