Drupal's Twitter Module

Jan 6 2010

Do you want to integrate your post with Twitter? The Twitter Module can help. This tutorial will provide you with the basics of installing and configuring the Twitter Module for your own blog site.

Setup Twitter Account

1. Download the Twitter Module, Place the module into sites/all/modules. Enable the Twitter and Twitter actions on your site.

twitter_module1.png

 

2. Go to admin/user/permissions and grant the appropriate permissions to your users.

 

3. To set up a Global account head to admin/settings/twitter, enter the user name and password. Leave Twitter Import checked if you would like the posts to be importer from Twitter in a block for example.

twitter_module2.png

Select the node types on your site that you would like to announce to Twitter when the post is published. Upon saving your configuration your account will be verified if the account cannot be verified an error will display. If all goes well, your configuration will be saved. Now each time you publish a post for the selected node types the post will also be announced on the twitter account designated in the global setup.

twitter_module3.png

3. Instead of establishing a global account, I prefer to set up Twitter under my account setttings. To do this head to your account and select edit.

twitter_module4.png

4. Then select Twitter accounts. Within Twitter accounts, enter your Twitter username and password and when you click on add account. Your Twitter account will display on top of the page. Be sure to check off import so that your Tweets will be imported into your site.

twitter_module5.png

Create a Twitter Block

1. The Twitter module comes with some predefined views. You can change those views to customize them for your site. Go to admin/build/views/list and click on the edit link the Twitter message view.

twitter_module7.png

2. Let's modify the default Tweets setting to narrow the set of imported tweets to your Twitter Profile. Click on the + next to Filters.

twitter_module8.png

3. Under Groups select Twitter account and place a check next to "Twitter Account: Login Name" and then click on add.

twitter_module9.png

Select the account name and update.

twitter_module10.png

4. Change the Style in basic setting to Table click update. 

twitter_module12a.png

One the next page, leave the default settings and click update.

twitter_module12c.png

5. To re-arrange the fields click on the up and down arrows next to fields and drag "Created time" above "Message text".

twitter_module12d.png

6. Click on the User Block display.  Change the Style in basic setting to Table, see previous steps above. The preview of your User Block should look something like this:

twitter_module15b.png

7. Now let's add an attachment to the User block display. Select Attachment from the drop down menu and then click on Add Display.

twitter_module16.png

8. Click on the "10" next to Items to display,  click on Override (the will override the default settings), enter 1 in the Items to display field and click on Update.

twitter_module17.png

9. Click on + to add a field, select "Twitter Account" from the drop down menu under Groups, check "Twitter Account: Profile Image" and click on update.

twiiter_module17a.png

10. Remove the text in the Label field and click on Update.

twitter_module17b.png

11. Click on the up and down arrows next to fields and drag "Twitter account: Profile Image" above "Message Text" and update.

twitter_module20.png

12. Under the Attachment Settings click on "None" next to Attach to and then check "User Block" and click update. 

twitter_module18 2.png

13. Click on "None" next to Footer, click on Override to override the default display. 

twitter_module23.png

Enter a link for your users to follow you on Twitter and click update.

twitter_module24.png

At this point your Attachment Preview should look something like this:

twitter_module25.png

14.  We need to make some more changes to the User Block display.  Click on the User Block display.  Click on "None" next to Title in Basic settings and give your block a title, I gave mine Latest Tweets, then click update. 

twitter_module26.png

15. Click on the number next to Items per page in Basic settings. We need to change the offset from 0 to 1 because the Attachment you just created will sit before the block and thus the Attachment will sit at position 0 while the User Block will begin at position 1. Don't forget to click update to save the changes.

twitter_module27.png

 

Preview your User Block Display and it should look something like this:

twitter_module28.png

16. Click "Save" an the bottom of the Views display! Now you will be able to go to admin/build/block/list enable your block and place it on your page for display. 

Links to useful resources:

Comments

Need your help

I am doing these steps but in localhost. I am not getting any results. Please help me.

Explain

bcwd's picture

What exactly is not working?

Flash • Dynamic Web Development