Blog Application

Last modified by Thomas Mortagne on 2024/02/05 00:24

blog.pngCreate and manage blog posts
Recommended
TypeXAR
Category
Developed by

Mohamed Boussaa, XWiki Development Team

Active Installs431
Rating
20 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

Creating one or several Blogs

By default a recent XWiki installation will provide a blog inside the Blog space. 

Since 9.4 the multi-blog feature is supported, it provides the following options:

  • The initial set of categories located in the Blog space will be shared by all existing blogs.
  • New blog can be created anywhere on the wiki, including under nested documents.
  • By default a new set of categories is created for each newly created blog.
  • All panels of the blog application will display contextual information based on:
    • The displayed blog document, OR
    • The displayed category or set of categories
    • Newly created blog will be configured with a minimal set of panels like the initial Blog located in the Blog space.

In order to not break the old blog,(before 9.4), use cases and to be able to aggregate posts of blogs using the same categories location we need to set the category property of the old blog posts to a default value when the post category is not set by the user.
Run the script available on the Blog.BlogPostsMigration page.

You can use the default blog (inside Blog space) or create a new one inside a new page using the Blog's Management. For that you just need to navigate to this URL: <URL to server:port>/xwiki/bin/view/Blog/Management. A new page will show up asking you to enter:

  • The title of the Blog
  • The location of the blog in the page hierarchy 
  • The blog categories location
  • Enable/Disable displaying blog panels
  • Check to create default categories (News, Personal, Other)
  • Select the layout of the blog posts (Calendar or Image)

newBlog.png
Create a new blog

After you have filled in the information click "Create". You now have a new blog!

Creating a new Blog Post

There are currently 2 ways of creating a blog post:

  1. By going to the Blog's homepage and using the "Create a new post" input where you enter the post title and hit the "Create" button:

    createBlogPostUI.png

  2. Or by using the standard + (create page) button from anywhere inside the Blog page (or one of its children) and by selecting Blog Post as your new page's type:

    blogPostTemplateProvider.png

Post image thumbnail

Since 9.4, an image thumbnail was added to blog posts in order to allow a more visual and appealing display of blogs posts and list of blog posts.
imageThumbnail.png
Blog post image thumbnail

Useful Macros

Since 9.4, Blog Post List macro, post layout macros and Blog Post Create Macro are available, these macros can be used to query and display blog posts anywhere on the wiki.

Blog Post List Macro

The Blog Post List Macro is used to query and display blog posts anywhere on the wiki, based on some parameters, the results can be displayed using customizable post layouts.

Usage

{{blogpostlist blog="Blog.WebHome" category="Blog.News" published="yes" layout="full" layoutParams="displayTitle=false" limit="10" /}}

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
blogyesa document reference The descriptor document of a blog (It should contain a document with a Blog.BlogClass object). Since 9.11, if the 'blog' parameter is empty, the blog descriptor is no longer initialized by default to 'Blog.WebHome', so, the macro will look for the blog posts in all the wiki not just on the default wiki (The blog under the 'Blog' space).
categoryyesa document reference Either a given category or a category space (not mandatory, at least blog or category mandatory)
publishedyesyes, no, allyesLimit results to published posts
hiddenyesyes, no, allnoLimit results to hidden posts
fromDateyesstring date Limit posts to posts published starting from a given date. The format of the date is yyyy-mm-dd.
toDateyesstring date Limit posts to posts published before a given date. The format of the date is yyyy-mm-dd.
limityesinteger10Number of posts to display
layoutyeslink,full,image, cardslinkThe name of the post layout macro that will be used to display the posts. The naming convention for the layout macros is: "BlogPostLayout${LayoutNameWithFirstLetterCapitalized}"
layoutParamsyesstring Additional parameters of the blog post layout
paginatedyesyes,noif the limit parameter is not provided the itemsPerPage is extracted from the blog descriptorUsed to enble/disable the pagination of the the blogPostList macro results

Blog Post Layout Macros

Blog post layouts are wiki macros created in order to customize the layout of blog posts. Currently 3 blog post layout macros are available: blogPostLayoutLink, blogPostLayoutFull and blogPostLayoutImage.

Usage

{{blogPostLayoutFull reference="Blog.MyFirstPost" params="displayTitle=true|useSummary=true"}}

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
referencenoa document reference The document reference of the blog post
paramsyesstring Additional parameters of the blog post layout

Examples of post layouts

linkPostLayout.png
The link post layout(BlogPostLayoutLink macro)

fullPostLayout.png
The full (default) post layout(BlogPostLayoutFull macro)

imagePostLayout.png
The image post layout(BlogPostLayoutImage macro)

Cards post layout

Since 9.9 the Cards layout has been integrated, the cards layout allow selecting pinned posts that will be displayed before the rest of the blog posts in big and beautiful blocs. see the following image gallery:

Note that the display of the pinned posts on the Cards layout can be enabled by setting the forceDisplayPinnedPosts parameter to true.

Use the Cards layout with the Blog Post List Macro macro as follows:

{{blogpostlist blog="Blog.WebHome" layout="cards" layoutParams="forceDisplayPinnedPosts=true" ... /}}

How to configure a new blog post layout?

  • Create the blog post layout using this naming convention: "BlogPostLayout${LayoutNameWithFirstLetterCapitalized}"
    eg: SomePage.BlogPostLayoutMyLayout
  • Configure a given blog to use the new layout
    • Edit the Blog.BlogClass, and for the field postsLayout, add the new layout name to the static list (|myLayout=My layout)
    • Edit the descriptor of your blog, and in the BlogClass object, change the layout to the new one.

Blog Post Create Macro

The Blog Post Create macro is used to insert a post creation form anywhere on the wiki. The macro takes a blog descriptor document as parameter. The new blog posts will belongs to the blog specified in the parameter.

blogPostCreate.png
The blog post create macro

RSS Feed for the Blog

In order to display the RSS Feed icon on your blog you have to add this line:

<link rel="alternate" type="application/rss+xml" title="Blog RSS Feed" href="$xwiki.getURL('Blog.BlogRss', 'view', 'xpage=plain')" />

to the Blog's Presentation HTTP Meta Information text area. You can reach that by clicking on Administration -> Administer Space: 'Blog Space Name' -> Page Elements.

If you want to provide feeds based on the Blog's Categories then drag the Blog Categories Panel onto your blog's sidebar. You can find that by selecting Administration -> Administer Space: 'Blog Space Name' -> Panel Wizard.

Display the Blog panels in other locations

Have you ever wondered how could you display the list of recent blog posts on the main page of the wiki? Since 9.9, it is possible to do that by specifying, in the current page, a Blog that you're interested in and what information should be presented using the existing Blog panels.
We implemented a Wizard, accessible from the More Actions menu (Blog configuration), to setup a configuration that would update the Right Panels section. If there are already some panels displayed, you can choose to keep them and add the ones from Blog, before or after, or even to replace them. See the images in following gallery:

Examples

The blog application is used for example on the Blog page of xwiki.org.

It is also possible to customize the Blog application for specific purposes. You will need some Velocity knowledge to do this, so please check the Developer's Guide for more information.

You can add / change blog categories on the http://<server>/xwiki/bin/view/Blog/ManageCategories page. 

A panel that lists all blog categories is also available. You can find it on the http://<server>/xwiki/bin/view/Blog/CategoriesPanel page of your XWiki.

Screenshots

BlogPanel.png
The Blog Categories Panel

BlogArticle.png
A Blog Article

XWikiBlog.png
A Blog Main Page

Since 9.4, Blogs panel is proposed to display all blogs sharing a same set of categories

blogsPanel.png
Blogs panel

Notifications

Since 9.2, users can observe the Blog Application in their notifications preferences:

NotificationSettings.png

Then, when a blog post is published, a notification is displayed on the top menu.

Notification.png

Blog categories

Category pages display the blog posts associated to the category from the blog. The layout of the blog posts list on the category pages follows the layout set at the blog level, for the blog to which the category belongs.

9.13+ Blog category pages can have editorial content that supports any wiki syntax. This content will be displayed above the articles list. In order to set / modify this content, edit the blog category page; whatever content you add in the content of the category page, it will be displayed above the blog posts list.

Changing the Style

The blog application uses a Skin Extension stored as an object attached to the Blog.BlogStyle document. In order to modify the Blog's style edit this document in Object Mode and modify the style as you wish.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Release Notes

v9.13.6

The following translations have been updated with this release:

v9.13.5

v9.13.4

v9.13.3

The following translations have been updated with this release:

v9.13.2

v9.13.1

v9.13

v9.12

v9.11.6

The following translations have been updated with this release:

v9.11.5

v9.11.4

The following translations have been updated with this release:

v9.11.3

v9.11.2

v9.11.1

v9.11

v9.10.10

v9.10.9

The following translations have been updated with this release:

v9.10.8

v9.10.7

v9.10.6

The following translations have been updated with this release:

v9.10.5

v9.10.4

v9.10.3

v9.10.2

v9.10.1

v9.10

The following issues have been resolved:

The following translations have been updated:

v9.9.1

v9.9

v9.8

v9.7.1

v9.7

v9.6

v9.5.1

v9.5

v9.4

v9.3.3

v9.3.2

v9.3.1

v9.3

Dependencies

Dependencies for this extension (org.xwiki.contrib.blog:application-blog-ui 9.13.6):

    

Get Connected