How to create a Plone Blog in 5 steps

by Redomino last modified Jul 10, 2009 04:24 PM
A Plone portal may require a blog area. Let's see how you can create it in an easy way using Plone as you get it out-of-the-box.

Goal

You have your own Plone portal and you want to add a blog area to it like the one you see in ReLabs: how can you do it?

You could just wander around looking for the right add-on able to implement this function to your site, but in this tutorial you will find out how to do it without installing any new product.

Requirements

In order to perform the following steps you will need to access your  Plone 3 as manager user.

Note: this tutorial may still be valid for older versions, too.

First Step

1. Setting the blog area

Enter your Plone portal as manager user, then add a new folder where you desire to put your blog and call it "Blog".

In this folder you can create your posts, each with its own image; so, from the menu "Add new...", select "Restrictions..."

plone-blog-home.png

and from the panel that will appear make sure you can only create "News", "File" and "Image" items, leaving this last two content types as secondary types.
Blog — my_site_2 (copy).png

This way you will be able to create a News Item for every new post in the "Blog" folder, plus uploading files and images to be attached to the post. Try creating a couple of test posts.

2. Preparing our blog's presentation view

You may want your posts to be displayed in a decreasing order by publication, so that the post placed in first position will be the last one. In order to do this we will create a Collection item.

But first you have to go back to the Restrictions configuration panel to check the content types you can add, and temporarily add Collection to the granted ones. After that, choose "Collection" from the menu "Add new..." and name it "Last Posts".

Now click on the "criteria" tab and set the following ones:

  • Location, choosing the folder "Blog" as location
  • State, choosing "public"
  • Item type, choosing "News Item" as value type

plone-blog-select-criteria.png

Finally set the Collection's sort order, choosing "Effective Date" as field name and checking the "Reverse" checkbox off.

Ready? Now click on the "View" tab of the collection. If you can't see anything, maybe your test posts aren't in a "public" status yet! Just public them and try again.

plone-blog-last-posts-private

3. Assigning the right template to the "Last Posts" view

Basically the job is done, but Plone allows you to do something better: change the default view of your Collection in order to make it look more catchy! Just click on the “Display” menu and select the “Summary view” option. And remember to switch the Collection status to "published".
plone-blog-summary-view
               

4. Assigning the "Last Posts" collection as view of the "Blog" folder

Go back to the "Blog" folder by clicking on the "Blog" tab that you see under the logo. Thanks to Plone you can select a particular view, which agrees to that of the Collection you've just created. From the “Display” menu  click on "Select a content item as default view...":

plone-blog-display-default-view.png

Choose "Last Posts" as selected page from the list that will appear:
Blog — my_site_7 (copy).png

Now your blog is ready, but you can still make some touch ups!

5. Customizing the Blog's portlets

Click on the "Manage Portlets" link that you see at the bottom of the side columns,  block the parent portlets on both the left and the right columns and then click on "Save settings". Then in the "Add portlet..." menu select "Collection portlet" (in the right or the left column, as you prefer).
Blog — my_site_8 (copy).png

In defining the portlet's properties be careful in selecting the "Target collection": you must write the title of the collection in the search box and press "Search", then select the collection you want to show in the portlet, in our example, we are looking for “Last posts”.
blog — my_site_9 (copy).png

Here we are!

Your Blog area is ready:
plone-blog-area-ready.png

Remember to make the "Blog" folder published, so that your anonimous visitors will see it:
plone-blog-published.png

Final Remarks

Thanks to Plone's powerful configuration mechanisms we were able to build a Blog area without nobody's help, doing quite a nice job!

We just saw the essential, leaving Plone's full power to your individual exercise. Just to give you some ideas, you could easily build a navigation based on tags by using the "Categories" attribute that you can find in the editing panel of every News item, or even build a multi-blog, with every blog folder having its author, that could be easily managed by the "Sharing" tab.

It may be a little more difficult to create a new custom content type to have at our disposal in place of News, explicitly called "Post"; but maybe we will show you this more advanced task in another how-to.

For users who wish to install a product that creates a blog instead of doing the work by hand, you may wish to check out Scrawl. Another popular product is Quills, but it is more heavyweight and may require more effort to set up