Quick Posts

Tagged


Inline asides, whatever you want to call them, prompted by Kristin enabling them on her site, this is how you do it with Habari.


There are a couple of things to look at before we get into the actual code:

  1. Habari doesn't use categories like WP or MT, we use tags.
  2. We need to choose a tag that will identify our inline asides.
  3. The Habari loop is much simpler than what you are used to from something like WP.


Okay, with that out of the way, let talk through what we are going to do to achieve the quickie/inline asides that you see on this site.



We start out with a posts object that contains all of our posts, and all the content therein. This includes the title, link, content, tags and comments. So we first call the Habari loop:



Now we should have a post object to work with that holds just the data for each post. Next we need to check for the tag we selected to identify our inline asides, in my case this is "quickie":

tags ) ) { ?>

title_out; ?> ยป content; ?> (comments->approved->count; ?>)

// continue with your normal HTML and CSS


And that is it, any entries you write that are tagged with "quickie" will be styled as such, and all other entries will be styled as normal.

I hope you enjoyed reading "Quick Posts"?
By becoming a Patron of Sillyness you can ensure quality articles, tutorials and code releases continue to be made available. Support independent content creation, free access to knowledge and open source code.

Thanks for reading.
— Chris J. Davis