bengillies.net

a blog by Ben Gillies

Blogging about blogging

I have recently updated my BlogLayout plugin, extending functionality and adding a few new features to make it more powerful so that you can use it in the way that you want to. As a result, I thought I'd go over it in a bit more detail here so that you can get a feel for how to use it.

Features


Getting one of the major questions out of the way first and foremost, the core of this blog runs on TiddlyWeb, however the plugin itself is pure TiddlyWiki. If you're running on something else, you should still be able to use it without any problems - it was designed and tested on TiddlyWiki so should work as such. I envisage TiddlyWeb specific plugins at some point in the future, but I'll save those for a later post.

So what can you do?

The first and primary feature of any blog is that it displays posts most recent first. This plugin is no different and by default will load in any posts tagged with a tag of your choosing. I chose "blog" personally, but feel free to pick something else.

The next, and possibly most obvious feature, is collapsing posts to provide a summary. This lets visitors see more of your posts, so lets them get to the one they're interested in sooner. This one has a few different options to help make it more powerful so I'll discuss it later on in more detail.

The third feature is limiting post counts. This means that if you only want to display 5 posts by default, but want all the others equally as available then you can, and any visitor to your site only has to click the "More Posts..." button to access them. This is fairly simple behaviour to use, so just set the post display count to whatever value you want, and this will happen by default. The post display count, along with other default options can be found in the BlogLayout plugin itself, or accessed via config.macros.BlogLayout.

The final feature regards links. Most blogs have links within their site separating content out into different themes. As a blog, I would expect these pages to also be laid out as a blog, possibly even in the same form as the homepage. This can also be achieved by calling recentByTagLink in place of an ordinary link. Simply supply some text for your link and a tag to link to to get started. Optional extras include specifying how many posts per page, whether to auto summarise those posts, and what the default height of each post needs to be before it is summarised.

Auto Summary


I mentioned earlier that there were a few different ways of using this depending upon how you feel it should work. by default, it will summarise all posts on the home page, and any that are linked to as in the above method. Any posts opened directly will not be summarised, and posts will not be summarised if opening via a different means. This is deliberate as when someone clicks a link, it is generally with the intention of reading the contents. However, you may want all posts to appear summarised wherever they were opened from. To do this you will need to add the following to the ViewTemplate tiddler, right below the ".viewer" div.

<div macro="collapseThisTiddler"></div>

This will run the macro on every tiddler by default. You may notice also that this means there is a macro to run this manually. This macro can also be placed at the bottom of any tiddler content and will run on that tiddler only, every time it is called. The macro itself can also be called with a default height for the tiddler, which will be used in preference to the default height supplied in config.macros.BlogLayout. Specifying -1 instead, will ensure that the post is never summarised, which is particularly useful for images.

Moving on to the default height, this can be also be specified on a per tiddler basis, by putting <<setCollapseHeightHere>> at the position you want summarised. This will then always be used in preference to any other default height, and should ensure that your posts always summarise at the height of your choosing should you so wish.

Finally, I'll just mention that there is a stylesheet allowing you to customise the "Read More" and "More Posts" links at StylesheetBlogLayout.

If you have any thoughts on this or suggestions for improvement, I'm on Twitter @bengillies so drop me a line.


Thanks
tags: blog

Comments

name:
comment:
This is practicable to get the issue related to paper writer or about this good topic in up to date world. But before some students buy the custom essays, they must determine the reliable custom essay service.
by Anonymous Coward