New themes: Carl Blue and Carl Green

Thanks to Carl Galloway I have just added two new Themes to our CVS repository: Carl Blue and Carl Green, both can be found on his site. Their specialty is a combined sidebar, and a slick, simple and professional look.

Have a try, and tell Carl if you like his Template! It should also be downloadable from Spartacus within the next 48 hours, but you can also download the themes on Carl's page

More Power to Smarty

I was pretty annoyed to see, that even though Serendipity is meant to be a blogging framework, there was no functionality to call a "print and fetch entry" function available within Serendipity.

Obviously, everyone was able to print his entries in a "blog-mannor" up today, with the default options to fetch and display entries. You had a lot flexibility by tweaking the entries.tpl template or by using Plugins. But now, we've taken it a bit further:

"More Power to Smarty" vollständig lesen

Static Blocks ("Include Entry" plugin revised)

The plugin Markup: Include entry data/ templates/ blocks (serendipity_event_includeentry) has received a major update to version 2.0 of the plugin.

Formerly, this plugin supported to include portions of already written entries into a new entry via this kind of markup:
[s9y-include-entry:47:body]

Thanks to the very smart suggestion of "Glamourguy", there's now a heap of extra-functionality for the plugin:

  • Creates a new menu item called "Template-Blocks". On this page you can administrate two types of content:
    • Templates: Here you can create text (title, body, extended) to use as actual templates for a new entry. You can choose a created template, and you will be forwarded to the "New Entry" screen, with the contents of your template already filled in. This helps you if you always create some kind of review texts or whatever, which you just mangle with actual content.
    • Blocks: This is some kind of "HTML nugget" block. Again you can create some text (title, body, extended). Those block can later be attached to any entry (see the "Extended Options" part when creating a new entry") or even be randomly distributed on the pages of your blog. This feature is very helpful if you want to create ad-blocks, subscription infos, reminders without the need to do lot of copy+paste work and have duplicate content!
  • It allows for several new config options:
    • Random block placement: This feature allows you to inject blocks on your blog entry listing randomly. You can define after which entry to start, the amount of articles before the next block appears, and whether a block should also be randomized if an entry already has an attached block.
    • Templated Blocks! The coolest thing about those "static blocks" is that EACH block can use an individual smarty template. The default is to show a block in an entry's design - but you can easily choose a different template for showing a block as an Ad-Block, an iframe, or everything else. You can even abuse the functionality to put actual (surrounding or replacing) content and the usual smarty markup into the block and tweak Serendipity to the max.
    • Category-dependant: You can choose whether to show randomized blocks on the startpage, or any combination of categories. So you can select to only show random blocks on the frontpage, or only in Category X (and Y and Z, but not A and B).
    • Apply Markup transformations to blocks. Of course, each block can use the markup plugins you defined to allow usage of Wiki/Textile/nl2br/smilies/whatever plugins. Or not. It's up to you!
  • And of course, it allows a new way of including blocks WITHIN entries (completely smarty-parsed) with this kind of code:
    [s9y-include-block:47] (includes the actual content only)
    [s9y-include-block:47:template] (includes the smarty-parsed content)

Did I mention this plugin even works with 0.8 already? Have a look at it and have fun - and report bugs, if you find any. It's still a bit beta-ish. ;-)

The plugin is available throughout the usual suspects: Spartacus (s9y Plugin-Repository) and CVS repository.

New Theme: Leaf

From the forums, the user Ziyad "MySchizoBuddy" Saeed contributed a new template called leaf, which is a port of a very pretty Nucleus theme by Ivan Fong. I have added his template to our CVS repository where it can be downloaded quite soon (< 24 hours because of SourceForge lag). People using the 0.9 checkouts will be able to fetch the template via Spartacus.

Here's a preview screenshot:

Thanks a lot!

Show tabbed categories?

A user on the forums asked how to build a tabbed category list. Following the principle of "there's more than one way to do it" I answered with a few different approaches how to solve that within Serendipity.

Let me say, that it can be achieved easily with little effort, thanks to the Smarty templating and the plugin API. You can even display a tabbed output of staticpages (see another forum post), since they assign $staticpage_XXX variables to the Smarty scope which you can check on in your index.tpl template. As well, building a function to fetch a list of staticpages (like the sidebar plugin for the staticpages does) could be integrated to not have any static HTML waste your templates. :)

Now, for the final question: Who is willing to contribute a tab-based category template, now that everything can be done in a template without modifying any core code or even requiring a plugin? :-)

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!