TIP BlogPlugin is not installed on Foswiki.org.


A blogging system for Foswiki

This plugin comes as a WikiApp to run a weblog using Foswiki. Based on the WikiWorkbench approach, it may be used to instantiate as many blogs as you like on the same Foswiki site.



snap1 snap2 snap3 snap4 snap5 snap6

%STARTSECTION{"screenshots"}%<div class="screenshots">
  <a href="%ATTACHURLPATH%/BlogPluginSnap1.png"><img src="%ATTACHURLPATH%/BlogPluginSnap1.png" width="150" alt="snap1" /></a>
  <a href="%ATTACHURLPATH%/BlogPluginSnap2.png"><img src="%ATTACHURLPATH%/BlogPluginSnap2.png" width="150" alt="snap2" /></a>
  <a href="%ATTACHURLPATH%/BlogPluginSnap3.png"><img src="%ATTACHURLPATH%/BlogPluginSnap3.png" width="150" alt="snap3" /></a>
  <a href="%ATTACHURLPATH%/BlogPluginSnap4.png"><img src="%ATTACHURLPATH%/BlogPluginSnap4.png" width="150" alt="snap4" /></a>
  <a href="%ATTACHURLPATH%/BlogPluginSnap5.png"><img src="%ATTACHURLPATH%/BlogPluginSnap5.png" width="150" alt="snap5" /></a>
  <a href="%ATTACHURLPATH%/BlogPluginSnap6.png"><img src="%ATTACHURLPATH%/BlogPluginSnap6.png" width="150" alt="snap6" /></a>

.screenshots a {
  margin:0 2px 2px;

Getting started

To create a new blog use the System.WebCreateNewWeb tool and select the _BlogTemplate template. This will create a new web by copying the content of the _BlogTemplate web into the new target web.

Now check the WebPreferences of this newly created web and review its settings, i.e. the access rights for the web.

Make sure you add a nice description of your blog in the WEBSUMMARY preference setting.

Create a new posting by clicking on BlogEntries on the sidebar. This will list all existing blog entries, as well as a form to create a new one.

Note that your posting will not be publicly visible unless you switched its State property to published.

Importing WordPress Content

BlogPlugin comes with a conversion tool to convert a WXR, the native way of WordPress to export its data to an XML file, into Foswiki content. This content will then make up a new web that you can run using this plugin. I.e. it will extract all tags and categories as well as comments.

The basic command to do so is:

cd <foswiki-dir>/bin
./rest /BlogPlugin/importWordPress ... param=value ... 

The importWordPress REST handler takes a couple of parameters, most imporantly the name of the XML file holding the blog data. It can either convert all of the data or just one blog posting given its ID.

Parameter Description
file path to the WXR file
id ID of a single blog posting to convert; by default all postings are converted
target name of a web to be created
override boolean flag weather to override the target web if it already exists
template template web to be used, defaults to _BlogTemplate
dry boolean flag to switch on/off real operations; you might want to test conversion first by enabling this flag

During conversion of postings a list of "downloadables" is collected and then fetched dynamically from the current WordPress site. This is foremost any images being used in postings.

There are a couple of features that are currently not converted to its Foswiki equivalent:

These WordPress macros will stay as they are in the text of a posting and will have to be fixed manually by now.

URLs of blog postings are created based on their title: spaces are removed and remaining words are concatenated forming a proper WikiWord. Any converted topic will contain the original URL of its WordPress as a comment at the end of the text. In case you'd like to replace the previous WordPress blog with Foswiki you may use the createRedirectMap to create a map of URLs used by the web server underneath to redirect old WordPress URLs to new Foswiki URLs.

Bulk-redirects from WordPress to Foswiki URLs

cd <foswiki-dir>/bin
./rest /BlogPlugin/createRedirectMap ... param=value ...

Parameters resemble those of the importWordPress REST handler as it operates on the same WXR file.

Parameter Description
file path to the WXR file
id ID of a single blog posting to create a redirect for
target name of the web holding the new Foswiki blog
path (optional) view path to blog postings, defaults to $Foswiki::cfg{ScriptUrlPaths}{view}
| format | specify the output format, can be nginx or apache (default)

Note for now the format of the resulting redirect map is only valid for Nginx out of the box. The output will look like this:

For apache (default):
/foswiki-patch-release-1-1-10/ /bin/view/Blog/FoswikiPatchRelease1110
/translations-needed-for-foswiki-2-1/ /bin/view/Blog/TranslationsNeededForFoswiki21
/foswiki-2-1-beta-available-for-testing/ /bin/view/Blog/Foswiki21BetaIsAvailableForTesting
/foswiki-2-1-released/ /bin/view/Blog/Foswiki21HasBeenReleased
/foswiki-2-1-2-available/ /bin/view/Blog/Foswiki212Available

Store the result in /etc/apache2/foswiki-blog.txt or the like and make use of it within a redirect rule such as

RewriteMap foswikiblog "txt:/etc/apache2/foswiki-blog.txt"
RewriteRule "^/(.*)" "/${foswikiblog:$1|NOTFOUND}" [PT]

For nginx:
~*/foswiki-patch-release-1-1-10/? /bin/view/Blog/FoswikiPatchRelease1110;
~*/translations-needed-for-foswiki-2-1/? /bin/view/Blog/TranslationsNeededForFoswiki21;
~*/foswiki-2-1-beta-available-for-testing/? /bin/view/Blog/Foswiki21BetaIsAvailableForTesting;
~*/foswiki-2-1-released/? /bin/view/Blog/Foswiki21HasBeenReleased;
~*/foswiki-2-1-2-available/? /bin/view/Blog/Foswiki212Available;

Store the result in /etc/nginx/foswiki.map and add a rule such as

map $uri $redirect_uri {
   include /etc/nginx/foswiki.map;

to your nginx global site settings.

Automatic publishing / unpublishing blog postings

Each posting has got three valus that specify whether it is visible to the outside (published) or not (unpublished). Unpublished blog postings will have according access control rules set automatically to hide them from public access.

Field Description
State possible values are published, unpublished: only blog entries in state published are readable by other users; unpublished blog entries are only visible for the authors of this blog entry
Publish Date only blog entries in state published are readable by other users; unpublished blog entries are only visible for the authors of this blog entry
Unpublish Date only blog entries in state published are readable by other users; unpublished blog entries are only visible for the authors of this blog entry

Automatic publishing is controled by the publish REST handler called regularly by a cron job such as:

0 0 * * 0 cd <foswiki-dir>/bin && ./rest/BlogPlugin/publish

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.



Change History

23 Jan 2017: improved compatibility with PatternSkin; using date2 instead of date formfield now; improved OpenGraph meta data in blog postings; disabled HyphenateContrib by default now due to typography issues; fixed calculation of comments; fixed rendering of breadcrumbs; fixed solr-based blog search; display type hierarchy on CompleteDocumentation now; improvements to FrontPageViewTemplate, RenderArchives, RenderBlogEntries, RenderBlogEntryPagination, RenderBlogEntryTitle, RenderRecentBlogEntries, RenderSimilarBlogEntries; improvements to rss and atom feeds, i.e. make them cacheable by default; new WordPress importer; index a publishdate property for dbcache entries; added new default WebLexicon feature part of latest WikiWorkbench and MultiLingualPlugin; added SeoTopic to blog template to be able to create seo pages that aren't necessarily a blog posting; added translation files for almost all supported languages, still low coverage
27 Nov 2014: added publish/unpublish feature
15 Apr 2014: improved topic info layout
04 Apr 2014: flag rest handlers that don't require authentication
18 Mar 2014: improve css of headings
07 Nov 2013: rewrite migrating most features to other Foswiki plugins
24 Jan 2006: initial version

Topic attachments
I Attachment Action Size Date Who Comment
BlogPlugin.md5md5 BlogPlugin.md5 manage 153 bytes 23 Jan 2017 - 18:49 MichaelDaum  
BlogPlugin.sha1sha1 BlogPlugin.sha1 manage 177 bytes 23 Jan 2017 - 18:49 MichaelDaum  
BlogPlugin.tgztgz BlogPlugin.tgz manage 1 MB 23 Jan 2017 - 18:49 MichaelDaum  
BlogPlugin.zipzip BlogPlugin.zip manage 1 MB 23 Jan 2017 - 18:49 MichaelDaum  
BlogPluginSnap1.pngpng BlogPluginSnap1.png manage 336 K 23 Jan 2017 - 18:49 MichaelDaum Frontpage
BlogPluginSnap2.pngpng BlogPluginSnap2.png manage 365 K 23 Jan 2017 - 18:48 MichaelDaum BlogEntry view
BlogPluginSnap3.pngpng BlogPluginSnap3.png manage 130 K 23 Jan 2017 - 18:48 MichaelDaum Editor
BlogPluginSnap4.pngpng BlogPluginSnap4.png manage 29 K 23 Jan 2017 - 18:48 MichaelDaum Tagging
BlogPluginSnap5.pngpng BlogPluginSnap5.png manage 45 K 23 Jan 2017 - 18:48 MichaelDaum BlogEntry Sidebar
BlogPluginSnap6.pngpng BlogPluginSnap6.png manage 16 K 23 Jan 2017 - 18:48 MichaelDaum Frontpage sidebar
BlogPlugin_installerEXT BlogPlugin_installer manage 14 K 23 Jan 2017 - 18:49 MichaelDaum  
Topic revision: r14 - 23 Jan 2017, MichaelDaum - This page was cached on 13 Feb 2017 - 17:32.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License