Do Anna Blog

29th January 2006

Vishal’s Nainital Photo

Filed under: Uncategorized — Tags: — Lokesh Shah @ 11:05:46

Nainital photo posted by Vishal.

Planning to do some photography in when I get there soon.

12th January 2006

JBlogEditor – Creating Custom Templates

Filed under: Uncategorized — Tags: — Lokesh Shah @ 08:27:03

With templates a user can customize how the blog entry is previewed before publishing. So instead of plain text, the preview tab will show

To use a template for preview in JBlogEditor, go to File | Blog Properties and check Use Template. By default JBlogEditor comes with one basic template. However its very easy to create custom templates to make the preview look like your blog.

Velocity template engine is used to generate the HTML for preview. If you not familier with Velocity, think of it as token replacement (Velociy is much more powerful, but for now JBlogEditor uses it like a token replacement engine). Each blog type supports certain set of tokens. A template is composed of normal HTML and these tokens. Just before preview is done, these tokens are replaced with their actual value and the generated html shown in the preview.

The template is made available is JBlogEditor by creating the template file in the C:\Documents and Settings\<username>\.jblogeditor\<blog name> directory. So in my case it is C:\Documents and Settings\lokeshshah\.jblogeditor\lokeshshah-wpBlog. (For those familiar with Eclipse, .jblogeditor is the default workspace used by JBlogEditor). The template file is must be named template.vm.

Here’s a simple template file:
[html]
body {
background:#859EB2;
margin:0;
text-align:center;
color: #ffffff
}
#blog-title {
width:660px;
background:#FF7F00;
margin:20px auto 0px;
font-size:200%;
padding:30px;
}
#content {
background:#0062B2;
width:660px;
margin:0px auto;
padding:30px;
text-align:left;
}
#date {
font-size:80%;
font-weight:normal;
}
#entry-title {
font-size:120%;
border-bottom:1px dotted #ccc;
}

$title

$entryDate

$entryTitle: by $user

$entryBody

[/html]

There are some special token that I have used in the html above: $title, $entryTitle, $entryDate, $entryBody, $user. These tokens are replaced by their actual values taken from the entry being previewed.

That’s all there is to creating new templates. Just relaunch JBlogEditor and start enjoying the new preview functionality.

JBlogEditor 0.6.0 released

Filed under: Uncategorized — Tags: — Lokesh Shah @ 02:00:13

Version 0.6.0 of JBlogEditor is available for download.

New Features:

  • Flickr Upload Wizard: JBlogEditor now includes a Flickr Upload wizard. Images can now be directly uploaded to Flickr and relevant URL added to the blog entry. Flickr integration uses flickrj. Thanks to the folks who work on this library.
    Screenshots (click on the image to see a larger size):

  • Template Support: JBlogEditor now supports templates for preview.
    Screenshots (click on the image to see a larger size):
  • Sorted Blog Entries: The Blog Entries view is now sorted and categorized by date.
    Screenshots (click on the image to see a larger size):
  • Numerous Bug Fixes: Numerous bugs have been fixed. Thanks to everyone who reported bugs.
Older Posts »

Blog at WordPress.com.