Background: Customer X has a CCK-based Content Type (vendor_entry) and is using Views2 to generate a listing of all the vendor_entry nodes in a simple table.

One of the fields in vendor_entry is called "vendor_attitude", which appears as one of the following enumerated possible values:

  • happy
  • sleepy
  • dopey
  • grumpy

Customer X has four custom-made 16x16 images that correspond to these enumerated values. He wants to have them display in the generated view, so instead of seeing "happy" in the generated view, the user would see the image happy.png in its place. Customer X would like to accomplish this without breaking the ability to sort individual columns as can be currently done with Views2 in table output mode.

Question: What methods would you use in order to substitute the text with the associated images? Assume that the images should only be substituted in one or more specific views (e.g., vendor_summary, vendor_by_date, vendor_by_industry), but not in the individual node views themselves.

Comments

Nick Lewis’s picture

Uh... I'd
1. look for the "theme information" link in that multi column view control thing.
2. I'd click it and look for a tpl.php file for that field that lets you know (approx) "vendor_summory = views-field--vendor_summary.tpl.php... "
3. I'd figure out my text to .gif swapping scheme out within my theme, in the tpl.php file.

Maybe that made sense.

--
"I'm not concerned about all hell breaking loose, but that a PART of hell will break loose... it'll be much harder to detect." - George Carlin
--
Personal: http://www.nicklewis.org
Work: http://www.entermedianow.com

--
"I'm not concerned about all hell breaking loose, but that a PART of hell will break loose... it'll be much harder to detect." - George Carlin
--
Personal: http://www.nicklewis.org
Work: http://www.zivtech.com