Huddled Masses
You can do more than breathe for free...
Browse: Home / Category tooltips

Category tooltips

By Joel 'Jaykul' Bennett on 26-Dec-2003

Well, if you’re like me, you’ve been dissatisfied with the “View all posts in the [insert name here] category” tool-tip that pops up when people mouse over the categories in your list… and I have a simple fix for you.

It’s really very simple, just open up your template functions file, and find the list_cats function. Right at the top of that there’s a section that reads:

$query  = "
      SELECT cat_ID, cat_name,
      COUNT($tablepost2cat.post_id) AS cat_count,
 

What you want to do is add the category_description to that:

$query  = "
      SELECT cat_ID, cat_name, category_description,
      COUNT($tablepost2cat.post_id) AS cat_count,
 

Then, further down the function change the cration of the link so that it reads like so:


        $link = '<a href="'.get_category_link(0, $category->cat_ID).'" title="' .
                ( ($category->category_description > '') ?
                        $category->category_description :
                         'View all post in the ' . $category->cat_name . ' category' ) . '">';
 

Similar Posts:

  • ShotGlass

Posted in Huddled | Tagged Huddled Masses

« Previous Next »

Lijit Search

Tags

.Net .Net 2008 Scripting Games Automation Bugs Design Development Funny Gadgets GeoShell GUI Huddled Masses Internet licensing Microsoft Modules My Software News Personal PInvoke Pipeline Politics PoshCode PoshConsole PowerBoots PowerShell PowerShell Functions PowerTips Rants Recommender Repository Scripting ShowUI Software Solutions Textile Tips User Group UserInterface WalkThrough WebHosting Windows 7 WordPress WPF Xml

About Huddled Masses

This is web site is dedicated to the musings of Joel Bennett (aka Jaykul) about technology, software, software development, the web, and the world.

Any resemblance of the views expressed and the views of my employer, my terminal, or the view out my window are purely coincidental. The resemblance between them and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader.

P.S.: I occasionally link to things I think are great. When I do, I occasionally find a "referral code" so I can make a little cash. I promise that I don't link to anything just because of that cash (I wouldn't cross the street for the amount of cash those links bring in, never mind write a whole blog post) ... but I do not promise that things I link to will stay great as time passes, nor that you will agree with me about their greatness!

Archives

  • January 2012
  • October 2011
  • August 2011
  • July 2011
  • June 2011
  • March 2011
  • February 2011
  • January 2011
  • November 2010
  • August 2010

Copyright © 2012 Joel Bennett.

Powered by WordPress and Hybrid.