Friday 2 November 2012

Embedding Tweets in IP.Board 3.3.4

If you wish to include a tweet in your posts you will find it isn't as simple as following Twitter's instructions at https://support.twit...ebsite-or-blog#

Including tweets in a post is a 3-step process:

1. Edit your globalTemplate.

Scroll down to the bottom and right above the </body> tag add the following line:

<script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

2. Edit your ipb_styles.css.

The default .post_body .post class looks like this:

.post_body .post { color: #282828; }

You want to edit it this way:

.post_body .post {
     color: #282828;
     overflow-y: hidden;
}

3. Now create a new BBCode.

Example code:

https://twitter.com/qikipedia/status/263009977877278720

Custom Tag:

Tweet

Custom BBCode Replacement:

<blockquote class="twitter-tweet"><p>Javascript is not enabled OR refresh the page to view</p><a href="{content}">Click here to view the Tweet</a></blockquote>

Optionally you can point the BBCode Image setting to a 16x16 twitter.png image in your public/style_extra/bbcode_icons folder.

This works for me and I haven't found any problems resulting from these edits, however all edits are at your own risk.