Welcome to Geeklog Wednesday, June 03 2020 @ 03:44 am EDT

Geeklog Forums

Twitter widget does not show up in a block


Status: offline

Dan Stoner

Forum User
Chatty
Registered: 28/01/09
Posts: 43
Location:Gainesville, FL
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?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

Dan Stoner

Forum User
Chatty
Registered: 28/01/09
Posts: 43
Location:Gainesville, FL
Ah, indeed. I'm on 1.7.0.

Thanks!
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
We also have at least one twitter plugin for GL.

-s

FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

All times are EDT. The time is now 03:44 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content