Subject: Twitter widget does not show up in a block

Posted on: 14/01/11 01:52pm
By: Dan Stoner

I attempted to add a Twitter widget to a block. I get no output when I add that code to a block (appears as just an empty block). I am using a Normal Block.

See example on my site, all the way down at the bottom right, should see a block named "Twitter" :

http://thatlinuxbox.com/blog/index.php?topic=General


The code for the Widget is from

http://twitter.com/about/resources/widgets

The Twitter code (what I pasted into my block) looks like this:

PHP Formatted Code

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 6000,
  width: 'auto',
  height: 300,
  theme: {
    shell: {
      background: '#333333',
      color: '#ffffff'
    },
    tweets: {
      background: '#000000',
      color: '#ffffff',
      links: '#4aed05'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: false,
    timestamp: true,
    avatars: false,
    behavior: 'all'
  }
}).render().setUser('thatlinuxbox').start();
</script>
 


The issue appears to be with the curly braces. When I save the block, the curly brace gets converted to a web-friendly representation.

e.g. When I view page source in my browser, the third line in the script section looks like this instead:

PHP Formatted Code
new TWTR.Widget(&#123;



Does anyone else have a Twitter Widget working ok inside a geeklog block?

Suggestions for making it show up?

Re: Twitter widget does not show up in a block

Posted on: 14/01/11 02:54pm
By: Dirk

Which Geeklog version are you on? We did some back and forth in the last two releases (1.7.0 and 1.7.1) there. From the 1.7.1 changelog:
- Reverted parts of the changes for bug #0001057: Do _not_ escape curly braces
when displaying a block's content (bug #0001156). If you run into the problem
that words in curly braces inside blocks are interpreted as template
variables, simply add a space after the opening and/or the closing brace

So this sounds like you're on 1.7.0, where that change was introduced?

bye, Dirk

Re: Twitter widget does not show up in a block

Posted on: 14/01/11 08:49pm
By: Dan Stoner

Ah, indeed. I'm on 1.7.0.

Thanks!

Re: Twitter widget does not show up in a block

Posted on: 16/01/11 03:01pm
By: suprsidr

We also have at least one twitter plugin for GL.

-s

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=91770