Category Listings in Drupal 6

in

In case you haven't noticed, I upgraded my web site to Drupal version 6 over the weekend.

The biggest challenge of Drupal version upgrades is making sure your theme and modules make the transition. The APIs can change radically between major releases. That means your add-on components won't survive the upgrade unless their maintainers are actively supporting them.

That's why, for instance, this site is running under a simple, barebones theme. The theme I was using hasn't been updated for version 6, so I had to leave it behind.

As far as modules, only one of my add-on modules wasn't available for version 6—and it's one I wrote myself.

I write a module called category_listing that provides a simple, themed list of taxonomy terms. It's what I used to produce my blog categories page.

The enhanced views module comes frustratingly close to providing this capability. I found two limitations.

First, the term description is wrapped in <p> tags, causing unwanted line breaks. I solved this in an extremely hackish way, by using CSS to remove block property from that element. Here is what I used:

.view-content .item-list li .views-field-description p {
  display: inline;
}

The second limitation is that my module provides article counts in the categories, and I didn't see any way to do this with the stock view mechanism. This is not a critical failing, but the article count is a very nice feature.

So, I did a quick port of the module to version 6 and that's what I'm currently using on this site. I'm going to continue researching whether I can get the standard views mechanism to do what I want. If not, I'll consider going ahead and publish the new version of the module.

Trackback URL for this post:

http://www.unicom.com/trackback/540

Rating

What do you think of this article? Please click the stars below to let me know.

Your rating: None Average: 3 (1 vote)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <img> <i> <b> <tt> <em> <strong> <cite> <code> <blockquote> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Each email address will be obfuscated in a human readble fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 16 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.