The word Blog is an apostrophe-less contraction of the two words web log. Blogs were first popularized by web sites such as Slashdot (http://slashdot.org) which have the format of a running list of entries to which users could attach comments. Over time, more and more sites such as Digg, del.icio.us, and Newsvine adopted the format, empowering users to share their opinions and generating lively discussions.
Over the course of time, blogging sites and applications began to appear, such as blogger.com, blogspot.com. TypePad, WordPress, and Web Roller. These applications allow individuals to run their own web sites in the same format: a running list of short articles to which readers who are registered with the site can attach threaded comments. People who run a blog are called bloggers, and sometimes they build a whole community of readers who are interested in their blog posts. Additionally, there are several famous people who run their own blogs. It gives people an outlet for self-expression which they would not otherwise have, and the ubiquity and wide reach of the Internet ensures that if you have something important and interesting to say, somebody will read it.
Illustration 53: Slashdot, one of the first blogs on the Internet. Liferay Portal has a portlet called the Blogs portlet which allows you to provide a blogging service to users of your web site. In fact, Liferay extensively uses the Blogs portlet on http://www.liferay.com to provide employees with blogs of their own. In addition to the Blogs portlet, there is also a Blogs Aggregator portlet which can take entries from multiple users' blogs and put them all in one larger list. We will go over how to use both of these portlets to create a blogging site for your users.
The Blogs Portlet
The Blogs portlet is available from the Collaboration section of the Add Application menu. You will notice that it is an Instanceable portlet, meaning that it can only be added once to any community or organization. This allows you to use the Blogs portlet to create a shared blog to build a site like Slashdot or to create multiple personal blogs to build a site like http://blogger.com. What's the difference? Adding the Blogs portlet to a Community or Organization page creates a shared blog for members of the Community or Organization. Adding the Blogs portlet to a user's personal space creates a blog for just that user. Either way, the Blogs portlet works the same.
Illustration 54: Initial view of the Blogs portlet. By default, the Blogs portlet will display the latest entry in its entirety. Since we have just added the portlet to a page, we have no entries, so the portlet will be empty. Before we start adding entries, we'll configure the portlet so that it displays entries the way we want it to.
Configuring the Blogs Portlet
Click the menu button (the one with three dots on it), and then click Configuration. You will see a page allowing you to configure the various options for the Blogs portlet:
Illustration 55: Blogs ConfigurationMaximum Items to Display: This allows you to choose the total number of blog entries to display on the initial page. You can choose up to 100 to be displayed.
Display Style: Choose between Full Content, the Abstract, or just the Title. Setting this to Abstract causes Liferay to display only the first 30 words of your blog entries, with a Read More link at the bottom of each to allow users to read the whole entry if they wish.
Enable Ratings: Allows you to enable your users to rate your blog entires from one to five stars
Enable Comments: Allows readers to comment on your blog entries.
Enable Comment Ratings: Allows readers to rate the comments which are posted to your blog entries.
Maximum Items to Display: Lets you configure the number of entries to appear in your RSS feed.
Display Style: Same as the display style for the web, but with the RSS feed.
Format: Lets you choose between RSS 1.0, RSS 2.0, or Atom formats for your feed.
Set the settings the way you want them and click Save.
Depending on whether this is a personal blog or a shared blog, you may want to modify the permissions on the blog. By default, the permissions are set up for a personal blog, so only the owner of the community to which the portlet has been added will be able to add entries. If you want to share a blog with multiple users, it is easy to do.
First, create a role for your bloggers and add them to the role. Next, click the Permissions button on the Blogs portlet. You will now see a list of both portal and Community / Organization roles, and currently only the owner is checked. Check off any other role that should have the ability to add blog entries, and then click Save.
Now you're ready to begin adding blog entries. Click the Add Blog Entry button. You will see the following data entry screen:
Illustration 56: Adding a Blog entryThere isn't much difference between this screen and any other data entry screen within Liferay Portal. You get a title, a way of scheduling when the entry is to appear, and a rich editor that allows you to format your entry the way you want, complete with embedded images, videos, and the like.
Note also that as you type, the entry is automatically saved as a draft at periodic intervals. This gives you peace of mind in using the portlet from within your browser, as you won't lose your entry in the event of a browser crash or network interruption.
You can also tag your entries using the same tagging mechanism found everywhere else in the portal.
The Blogs portlet also supports trackbacks. These are special links that let you or another site know if you or if someone else linked to a blog entry. For example, if you wanted to write an entry in your blog and reference someone else's entry, you might put the URL to the other entry in the Trackbacks to Send field. Similarly, if you want others who link to your blog to let you know about the link via trackbacks, leave the Allow Incoming Trackbacks box checked. This will generate a URL that is displayed with your blog entry. Others who want to link to your entry can use this URL for the link, and every time the link is clicked on, your Liferay-powered site will know about it and will be able to keep track of the clicks.
Once you have finished your blog entry, click Publish. You'll go back to the list of entries, and you will see your entry. Here is what it looks like when the display style is set to Abstract and the number of entries is set to 10:
Illustration 57: First blog entry added. You can see that in the summary view, you don't see the trackback link, and you only see the number of comments which have been added. If you were to click the Read More link, you would see the entirety of the article, all of the comments in a threaded view, and the trackback link which others can use to link back to your blog entry.
Additionally, the full view of a blog contains convenient links to add blog entries to popular aggregating sites such as Digg, del.icio.us, and others. This gives your readers an easy way to submit your blog entries to these aggregators, potentially driving further traffic to your site.
As you can see, the Blogs portlet is a full-featured blogging application which will give you and your users the ability to enter the blogosphere with an application that supports anything a blogger needs.
Aggregating Blog Entries
You can set up a whole web site devoted just to blogging if you wish. The Blogs Aggregator portlet allows you to publish entries from multiple bloggers on one page, giving further visibility to blog entries. This portlet is also very easy and straightforward to set up. You can add it to a page from the Collaboration category in the Add Application menu in the dock.
If you click Configuration from the menu button in the title bar of the portlet, you will see the Blogs Aggregator's configuration page. From here, you can set several configuration options:
Illustration 58: Blogs Aggregator ConfigurationSelection Method: You can select Users or Scope here. If you select Users, the Blogs Aggregator will aggregate the entries of every blogger on your system. If you want to refine the aggregation, you can select an Organization by which to filter the users. If you select Scope, the Blogs Aggregator will contain only entries of users who are in the current scope. This will, in essence, limit the entries to members of the Community or Organization upon which the Blogs Aggregator portlet resides.
Display Style: Just like the Blogs portlet, you can select from several different styles for displaying blog entries.
Maximum Items to Display: Select maximum number of entries the portlet will display.
Enable RSS Subscription: The aggregated entries can themselves be an RSS feed. Leave this box selected if you want people to be able to subscribe to your aggregated blog entries.
When you have finished setting the options in the portlet, click Save. Then click Return to Full Page.
As you will see, the Blogs Aggregator looks very much like the Blogs portlet, except that the entries come from more than one author.