News Box Blogs

I'm not sure where it started, but the first place I saw it, was on trac-hacks.org. I'm talking about the really cool green box that holds the "news". What's even cooler, is combining the green news box with the blog plugin. This is what trac-hacks.org is doing.

The green news box is a little mix of HTML and CSS, and it's dead sexy to have. zachtib was looking for instructions on how to set it up, so here we go

After installing the blog plugin, add the following CSS to the site_css.cs file. It is located in the Trac environment's templates directory.

#newsflash {
        border: solid 2px #8f8;
        width: 400px;
        float: right;
        background: #dfd;
        font-size: 0.8em;
        margin: 0em;
        padding: 0.5em 1em 0.5em 1em;
}
#newsflash h1 {
        font-size: 1.2em;
        padding: 0em;
        margin: 0em;
}
#newsflash .post hr {
        display: none;
}

Once the CSS is inplace, the green box can be created by placing the following at the top of the wiki page on which it should appear.

[[html(<div id="newsflash">)]]
[[BlogShow(blog,news,hidecal=true,num_posts=4)]]
[[html(</div>)]]

Obviously, the options passed to the [[BlogShow]] macro can be adjusted to taste.

Finally, after having done all that, I find a gem that coderanger has created: NewsFlashMacro. While I haven't tested it out, this should provide exactly what the above does, and packaged in to a nice macro.

  • Posted: 2007-01-16 21:37
  • Author: pacopablo
  • Categories: (none)

Comments

No comments.