Maintaining sub-blogs: Turn a category into its own blog

Thanks to some suggestions on the forums, especially by Robert Lender and Marc "Col. Kurtz" Gärtner, I have contributed a plugin that allows basic modification of a category into its own blog.

First off, the changes needs a fresh 0.9 SVN checkout, as some important plugin hooks were added to support the changes. On top of that you will need the new plugin serendipity_event_categorytemplates ("Properties/Templates of categories"), which is put into CVS and will be available via Spartacus shortly. You may also need the serendipity_event_sidebarhider ("Toggle Sidebar state") plugin for some advanced usage.

Now let me describe what the plugin does. It adds three new fields to the properties of each category. There you can now define the individual template used when viewing that category, define the amount of entries to be pulled (fetchLimit) and define whether the category is allowed to show entries of the future or not. All those settings override your global default, when a visitor comes to your page.

You need to enter the relative path for the template into the input box - a select dropdown may get available in the future. You can not only choose a different maintemplate ("blue", "kubrick", "moz-modern" etc.) - you can even select a sub-template of your template. Like "kubrick/category1", "kubrick/category2" and so forth. The directory structure of a "sub-template" is the same as a completely different template. So you have all options to fully tweak your templates dependant on the selected category.

Now, wouldn't it be nice to only show certain sidebar plugins on specific categories? For that, you can use the Sidebarhider plugin. You can toggle a list of categories that is allowed to display each sidebar plugin. That means you might want to show the Calendar plugin in Category A, B and C - but not in category D. Or you might want to show a special HTML nugget only in Category A. No problem. :-)

Of course there might be some bugs popping up, which is why it also requires Serendipity 0.9. Feel free to report errors on our bugtracker, the forums, mailinglist or whatever you prefer. I personally prefer the Sf.Net Bugtracker, though.

This extra flexibility is just another brick in the wall of showing the nice featureset of Serendipity, and what can be achieved with plugins. Be inspired and have fun!

"Include Entry" Plugin

I have committed a plugin called "Markup: Include entry data".

This plugin allows you to use HTML-like tags to include portions of other written entries in your current entry, by using this code in your Entries (and by configuration comments, nuggets, ...):


This would show the body and title of Entry #42 in your current entry. Beware you may face caching issues and that markup of those entries may only get parsed if you put this markup plugin before the other markup plugins.

I hope someone can use it. It is a cool shortcut to include the introduction "body" of an entry in your sidebar with a link to the full entry.

New Plugins: Audioscrobbler, Currently..., Page Nugget, Language Nugget

A new plugin contribution by Flo Solcher has been added to our Repository, which adds a Audioscrobbler XML interface to the sidebar plugins. Thanks a lot!

There are also some more plugins that got committed the last days and have not yet been mentioned here.

One is the "Currently ..." plugin by Dustin Hawkins. It fetches Amazon hits for your entered games/movies/books you are currently enjoying and shows them in a sidebar.

Another one is "Page Nugget" plugin by Wesley Hwang-Chung, which allows you to place random HTML at several occasions in your template (header/footer) without needing to modify your .tpl template.

The last plugin to be announced is also done by Wesley Hwang-Chung and is called "Language specific HTML nugget". This allows you to show HTML nuggets only for certain interface languages.

Thanks for all your work on improving Serendipity!

Trusted Authors Plugin

I have committed a new plugin "serendipity_event_xsstrust" to our additional plugins module.

This plugin can be very helpful for multi-user blogs where you do not fully trust your authors. Since Serendipity is aimed to providing an interface to type HTML code as an author, this means on a multi-user blog every user can insert JavaScript and any HTML he likes to your entries. This in effect also means that any author may insert "XSS" into your blog, and this is not a bug in itself since as a single blog owner you want to have the freedom to enter any HTML you like.

Thanks to Absynth, I got an idea to create this plugin. It can be configured by the site owner to tell, which authors are trusted. Only those trusted users can insert HTML code. All other authors get htmlspecialchars() applied to their code and can no longer exploit code.

If you don't want the plugin to break transformed BBcode or Emoticons, you need to stack the plugin BEFORE any other Markup related plugins, so that the htmlspecialchars() only gets applied to the user input and not any plugin outputs.

I urge the users who run an open membership blog to think about using this plugin. Have fun. :-)

Staticpages to support different templates

I have committed a patch to the staticpage plugin. In it's latest version 2.5, the plugin now supports to enter different smarty templates file for a specific static page.

This allows you to differently format certain static pages by altering their surrounding HTML structure. You can use any Smarty templating means available in those *.tpl files and you now no longer need to edit the PHP code if you want to make layout changes.

I hope some of you might find this feature interesting when using Serendipity for some CMS-like tasks.