scriptygoddess

22 Oct, 2002

category posts in columns

Posted by: kristine In: MT hacks

Someone asked about this on the MT forums, and I really liked how the answer turned out, so I thought I'd add it over here.

Some weblogs have a specific set of categories and would like to divide up the index page in columns to help segragate the posts. One such blog is BlogCritics. Other news-format blogs could be easily enhanced this way too.

This code will create the classes for the stylesheet and then the html to display them by using MTArchiveList tags. The stylesheet is adapted from Glish's example.

<html>
<head>
<title>Categorized Columns.</title>
<style><!–
body {font-size: 13px; font-family: verdana;}
<MTArchiveList archive_type="Category">
#<$MTArchiveCategory$> {
width:23%; change this depending on how many categories you have
float:left;
padding:10px;
}
</MTArchiveList>
–></style>
</head>
<body>

<MTArchiveList archive_type="Category">
<div id="<$MTArchiveCategory$>">
<$MTArchiveTitle>
<MTEntries lastn="2"> change this to how many posts you want to show for each category
<b><$MTEntryDate$><br></b>
<$MTEntryBody$>
</MTEntries></div>
</MTArchiveList>
</body>
</html>

You can see how this looks on my lovesongs (my music blog) test page. I'd recommend not using this if you have more than 5 categories, as it will leave pretty skinny columns!

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

3 Responses to "category posts in columns"

1 | kadyellebee

October 22nd, 2002 at 10:43 pm

Avatar

SG stuff
While I'm on my updating trend this evening, I'll let you in on the two new posts I made at

2 | cal

March 21st, 2003 at 8:32 am

Avatar

is there any way you could re-list that stylesheet to work for *anything* that one would want to have in columns? for example, i am in the process of re-doing my design at writtenonthesky.com, and want to put columns in for links, as well as my archives, etc. thanks so much!

3 | djwudi

October 23rd, 2002 at 2:56 am

Avatar

Interesting tip! I've been doing something similar on my full archives page, but using a table layout and just the titles. I'll keep this in mind, though – might work well for other projects!

Featured Sponsors


  • Curt: If anyone comes across this with similar issues I was able to sort out the pagination issues painlessly with easyCommentsPaginate from http://www.mush
  • Christopher: Yeah, it is indeed hard to do. And something remains elusive about why the pagination never worked. I tried everything I could find. Regardless, I
  • Jennifer: Hi Christopher, always hard to bug test stuff like that remotely. Sorry those didn't help. Glad you found a solution though :)

About


Advertisements