How to Add a Twitter Feed Gadget to Your Website
eXo Platform 4 provides many features for building rich websites out of the box. But you can also use the platform's web-based IDE to build custom plug-ins or gadgets that add an almost limitless number of capabilities. We wrote a simple gadget that displays a Twitter feed of all the recent company-related tweets, which is an easy way to display fresh content on a site's homepage. This tutorial will guide you through the process of creating the Twitter gadget and adding it to a website page.
To be able to complete this how-to, you will need eXo Platform Enterprise Edition 4.0 up and running.
Step 1: Generating the Widget
To integrate the standard Twitter gadget, first go to the Twitter widget page. Click “Create new” to create a new widget.
Switch to Search tab and fill in the search query for the type of feed you want to display (in our case, we want to display any tweets from our company account or our CEO, so we entered “@exoplatform” or “@benjmestrallet”). Click on “Create widget”.
Copy the generated code.
Step 2: Creating the Gadget
Login to eXo Platform portal as an administrator user. In the "Administration" drop-down menu, go to the IDE. In IDE app, select menu File -> New -> Google Gadget. Specify a name for your gadget (e.g: TwitterFeed.xml). In the CData tag, paste the widget code provided by Twitter.
Our code looks like this:
If you want to see your gadget working from within the IDE, click on "Run" -> "Show preview" in the menu.
To finish, go to the "Run" menu and click on "Deploy gadget to GateIn".
Step 3: Adding the Gadget to the Application Registry
Before you are able to insert the gadget in a page, you need to make it available to webmasters by adding it to a category in the application registry.
Step 4: Inserting the Widget in Your Homepage
Now you are done with the configuration, so you can insert the new Twitter widget on the Intranet homepage. On the homepage, from the "Edit" menu, select "Page -> Edit Layout". In the editor, you simply drag and drop the gadget to the page. Here is your result:
In only 4 simple steps, you should now have a custom Twitter feed integrated in your homepage. You can also quickly integrate any kind of widget into your portal following this process.