Create blogs on your website

You can create one or more blogs on your website with this package. Blog entries are listed chronologically (latest to oldest). They can be filtered by month/year or tag, and the number of most recent posts displayed on a page can be adjusted. Readers can comment on blog entries and instantly bookmark or share them at many popular online communities and services (such as Twitter, Facebook, Delicious, MySpace, Digg and many more). Entries of each blog can be exported as an RSS feed and aggregated in any RSS reader. You can use external applications such as Windows Live Writer or Microsoft Word to write and publish your blog posts.

How to implement Composite.Community.Blog

You can add a blog to your website in one of the two ways:

  • by creating a new page
  • by editing an existing page

The first approach is recommended because it automatically adds the Blog application and the blog-related functions to the page you are about to create if you select the Blog page type for it.

The second approach implies that you should add the Blog application and the blog-related functions to an existing page manually. In the following sections, you can learn more about each approach.

Implementing Composite.Community.Blog by creating a new page

Important: The template used to create a new page must have two placeholders with the IDs matching those defined in the Blog page type.  By default, these IDs are "content" (for the BlogRenderer function) and "aside" (for the TagCloud and Archive functions). 

You can either have a template (new or existing) with the needed placeholder IDs or edit the Blog page type and change the placeholder IDs to those used in your page templates.

If either or both IDs are not present in the template, the needed functions will not be added automatically and you will need to add them to the page manually.

To add a blog to a website automatically:

  1. Make sure that the template used to create new pages includes two placeolders with IDs matching those defined in the Blog page type.
  2. From the Content perspective, select a page under which you want to create a new page for blog entries and click Add Page on the toolbar.
  3. In the Add Page wizard, fill out the fields, and make sure you selected the Blog page type in the Pagetype selector.
  4. Click Finish.

Selecting the Blog page type will add the Blog application and blog-related functions to the page.

Implementing Composite.Community.Blog by editing an existing page

To add a blog to a website manually:

  1. In the Content perspective, right-click a page you intend for blog entries and add the Blog application from its context menu.
  2. Edit this page and add the Composite.Community.Blog.BlogRenderer function (Insert > Function) in Visual mode or insert the following markup on the page in Source mode:
  3.  
    <f:function name="Composite.Community.Blog.BlogRenderer" xmlns:f="http://www.composite.net/ns/function/1.0"> 
      <f:param name="BlogEntriesCount" value="5" /> 
      <f:param name="BlogListOptions" value="Show teaser,Show author,Show date,Show tags,Show share icons" /> 
      <f:param name="BlogItemOptions" value="Show content,Show author,Show date" /> 
    </f:function>
  4. If necessary, specify its optional parameters:
    • Blog Entries Count: The number of most recent entries to show on the page (5 by default).
    • List options (BlogListOptions): Additional data to show when displaying blog posts in a list, such as the image, teaser, content, author, date, tags, share icons, RSS link. (By default all data is displayed except for the image, content, RSS link.)
    • Item options (BlogItemOptions): Additional data to show when displaying an individual  blog post, such as the image, teaser, content, author, date, tags, share icons. (By default  the author, date and content are only  displayed.)
  5. If necessary, add an archive and a tag cloud to the page, too (see below).

How to add an archive to the blog

To allow the user to view older entries, consider adding an archive to the blog:

  1. Edit the page with the blog entries.
  2. Select the place where the archive links must appear. (If necessary, edit the page layout.)
  3. Add the Composite.Community.Blog.Archive function ( Insert > Function) in Visual mode or insert the following markup on the page in Source mode:
     
    <f:function name="Composite.Community.Blog.Archive" xmlns:f="http://www.composite.net/ns/function/1.0" />

The function groups all the entries by month (incl. the year) and display the links to the groups (months) indicating the number of entries posted in that specific month.

Note: If you use this function on a page other than the "blog" page (where the Blog application is added):

  • Specify the "blog" page in the Blog page parameter.

How to add a tag cloud to the blog

To allow the user to filter blog entries by tags (subjects), consider adding a tag cloud to the blog:

  1. Edit the page with the blog entries.
  2. Select the place where the tag cloud must appear. (If necessary, edit the page layout.)
  3. Add the Composite.Community.Blog.TagCloud function ( Insert > Function) in Visual mode or insert the following markup on the page in Source mode:
     
    <f:function name="Composite.Community.Blog.TagCloud" xmlns:f="http://www.composite.net/ns/function/1.0"> 
      <f:param name="MinFontSize" value="10" /> 
      <f:param name="MaxFontSize" value="22" /> 
    </f:function>
  4. If necessary, specify the following parameters:
    • Minimum Font Size: The font size for the tag used in the greatest number of blog entries (10 px by default).
    • Maximum Font Size: The font size for the tag used in the smallest number of blog entries (22 px by default).

The function groups all the entries by tag and displays the links to the groups (tags) indicating the number of entries posted with that specific tag.

Note: If you use this function on a page other than the "blog" page (where the Blog application is added):

  • Specify the "blog" page in the Blog page parameter.

How to show the latest blog posts

You can display the concise list of latest five blog posts on any page on your website:

  1. Edit a page.
  2. Add the Composite.Community.Blog.Latest function ( Insert > Function) in Visual mode or insert the following markup on the page in Source mode:
     
    <f:function name="Composite.Community.Blog.Latest" xmlns:f="http://www.composite.net/ns/function/1.0"> 
      <f:param name="Count" value="5" /> 
    </f:function>

  3. If necessary, specify its optional parameters:
    • Count: The number of latest posts from one or more blogs to show on the page (5 by default).

Note: If you have multiple blogs on one website, the latest post from all the blogs will be aggregated in the list.

Adding an author

Before posting on a blog, at least one blog's author must be added. When you install the package, an author named "Anonymous" is added. You can add a new author or edit and reuse the "Anonymous" author.

To add an author:

  1. In the Content perspective, expand Website Items, then Blog Settings.
  2. Under Blog Settings, select Authors and click Add Author on the toolbar.
  3. Fill out the required field:
    • Name: The name of the blog's author. Also used as the username to post to the blog from external applications  (Windows Live Writer etc) via MetaWebBlog (see below).
  4. Fill out the optional fields if needed:
    • Email: The author's email address. (The author will receive notifications by email at this address on new comments if the "Notify on new comments" option is turned on on a blog entry.)
    • Picture: The photo or image to graphically represent the blog's author.
    • Display Email: If checked, the author's name on a blog entry will be linked to the author's email address by clicking which a reader can send an email to the author; otherwise, no link.
    • Password: The password used by the author to post to the blog from external applications  (Windows Live Writer etc) via MetaWebBlog. External posting is impossible when the password is blank.
  5. Click Save.

Adding a tag

Tags help classify blog entries by subject and allow blog readers to filter blog entries by these subjects. Before posting on a blog, you can specify one or more tags. Whne you install the package, a tag named "About" is added.

To add a tag:

  1. In the Content perspective, expand Website Items, then Blog Settings.
  2. Under Blog Settings, select Tags and click Add Tag on the toolbar.
  3. Type the name of a tag in the Tag field.
  4. Click Save.

Posting from the console

  1. From the Content perspective, expand the page with the blog entries and select BlogEntries under the page.
  2. Click Add Blog Entry.
  3. On the Settingstab, fill out the following fields:
    • Title: Type the title of the blog entry. (Consider a short title for quick reference in lists and feeds.)
    • Image: Select the image to illustrate the blog entry. Keep the <NONE> option to assign no image. (Note: The sizes of the image can be customized in the CSS - please see Customization below.)
    • Teaser: Write the summary or highlights of the blog entry's content. (Consider a short description, one or two lines long.)
    • Date: Select the date of the blog entry's publication.
    • Author: Select the name of the blog entry's author. (Note: You must set up at least one author before posting entries.)
    • Display comments: Select this option to allow displaying comments to the blog entry. (The blog entry will include the form to submit comments and the comments if any).
    • Allow new comments: Select this option to allow new comments to the blog entry. (The blog entry will include the form to submit comments. When disabled, only posted comments will be displayed.)
    • Notify on new comments: Select this option to send notifications by email to the author when new comments are posted. (Note: To use this option you must configure the email host.)
  4. On the Tags tab, select one or more tags to assign to this blog entry by placing a check mark in a corresponding check box. (Note: To be able to select tags, you must set them up before posting entries.)
  5. On the Content tab, write the text for your blog entry.
  6. Click Save.
  7. Click Publish when the blog entry is ready for publication.

Posting from external applications

In addition to posting to the blog from the C1 Adminsitrative console, you can post from external applications via MetaWeblog. When setting up a blog account in such an appliation, make sure to:

  1. Select MetaWeblog as an API.
  2. Provide the URL to the blog posting script/handler on your website: http://<hostname>/BlogMetaWeblog.ashx (e.g. http://www.contoso.com/BlogMetaWeblog.ashx).

The latter is installed when you install the latest version of Composite.Community.Blog.

Below are examples of how to set up posting from two applications that support MetaWebBlog API:

Posting from Windows Live Writer 2011

Before you post to your blog, make sure you have set up the blog account providing the correct Blog Post URL to your website:

  1. Click Home, Blog, Add Blog Account.
  2. On the Blog Services page, select Other Services and click Next.
  3. On the Blog Account page, set these parameters:
    • Web address of your blog: Type in http://<hostname>/ (e.g. http://www.contoso.com/)
    • User name and Password: Type the name and the password you have set up when adding an author in the console. (Optionally, you can select to remember your password.)
  4. On the Blog Type page, set these parameters:
    • Type of blog you are using: Select Metaweblog API
    • Remote posting web address for your blog: Type in http://<hostname>/BlogMetaWeblog.ashx (e.g. http://www.contoso.com/BlogMetaWeblog.ashx)
  5. On the Select Blog page, select the blog you want to post to and click Next.
  6. Optionally, you can choose to download a publishing theme to view what the blog post will look like.
  7. Click Finish, to confirm the name of, and save, the blog.

Now in the opened document, type in the title, select the Account if necessary, and start writing your post. Once done, click Publish.

(Please refer to the standard Windows Live Writer 2011 documentation for more information.)

Posting from Microsoft Word 2007

Before you post to your blog, make sure you have set up the blog account providing the correct Blog Post URL to your website:

  1. Click the Office Button, Publish, Blog.
  2. Click Blog Post, Manage Accounts.
  3. In the Blog Accounts window, click New.
  4. For the blog provider, select Other and click Next.
  5. In the New Accountwindow, set these parameters:
    • API: Select MetaWebLog
    • Blog Post URL: Type in http://<hostname>/BlogMetaWeblog.ashx (e.g. http://www.contoso.com/BlogMetaWeblog.ashx)
    • Name and Password: Type the name and the password you have set up when adding an author in the console. (Optionally, you can select to remember your password.)
  6. Back in the Blog Accounts window, you can set the newly added account as default.
  7. Click Close.

Now in the opened document, type in the title, select the Account if necessary, and start writing your post. Once done, click Publish.

(Please refer to the standard Microsoft Word 2007 documentation for more information.)

RSS Feed

The Composite.Community.Blog supports exporting blog entries as an RSS feed. The user can access the RSS feed URL via the "RSS" link at the bottom of a blog entry (in the "content" mode of the blog list) which is generated automatically.

In general the feed can be accessed as:

http://<server_name>/BlogRssFeed.ashx?bid=ce81e280-3caa-498a-aeec-ab58b576c891&cultureName=en-us

where:

  • 'bid' is a required parameter that contains the GUID of the page where the blog is
  • 'cultureName' is a parameter that specifies the culture name of a localized version of the blog. If not specified, the default language of the website is used.

To manually create an URL to the RSS feed, you should at least specify the 'bid' parameter.

Localization

The strings used in the Blog package are stored in the resource file at: App_GlobalResources\Composite\Community\Blog.resx. To localize the strings:

  1. Make a copy of this file and name the copy by appending the language code (e.g. 'da-DK') to its file name (model: <FileName>.<LanguageCode>.resx): e.g. Blog.da-DK.resx
  2. Edit the created file and replace strings in English with strings translated into the target language.
  3. Save the file.

Important Notes

  1. To send notifications by email to the author of a blog entry every time a new comment is posted, you must specify a valid email address when adding an author and configure the email host.
  2. In C1 1.3, you can add authors and tags in Content: Blog Settings > Authors.
  3. Posting to the blog from external application is only available in C1 2.0 or later.
  4. The Password field in the Author form is only available in C1 2.0 and later.

Customization

You can customize the layout by editing the style sheets:

  • /Frontend/Composite/Community/Blog/Styles.css

To set up sizes of the image assigned to a blog entry, customize the <img> element of the BlogItem class in the style sheet. E.g.:

.BlogImage {width: 100px; height: 100px;}

Requirements

Composite C1 v. 3.2 or later

SHARE