Project:Frequently Asked Questions
Version:5.x-2.5
Component:Code
Category:feature request
Priority:normal
Assigned:stella
Status:closed (fixed)

Issue Summary

It would be a great little addition to be able to show the Taxonomy Image in front of the term (faq category) on the FAQ page. If I get a few spare minutes, I might even code a patch for you because this is pretty simple (http://drupal.org/node/101682).

Comments

#1

Oh, yes, I do mean on the "questions/answers in a new page" format.

#2

Status:active» needs review

Here's a patch for this. As you can see, it's pretty simple.

AttachmentSize
faq_taximg.txt 944 bytes

#3

Assigned to:Anonymous» stella

Hi,

I liked this idea but unfortunately not the implementation. I've created a new patch which has the same functionality. The major differences are:

  • Users now only see taxonomy images if they have the "access taxonomy images" permission.
  • The taxonomy image now appears in front of the term name in category listings and before the term description when viewing a faq category page, e.g. "faq/123".
  • Support for taxonomy images are now supported for all faq categorisation layouts, not just "Clicking on category opens the questions/answers in a new page".
  • The styling of the taxonomy image is now controlled by a new css class "faq_tax_image" rather than set in the php code.

I'd appreciate it if you could try out the new patch and let me know what you think before I commit it to CVS or port it to drupal6.

Cheers,
Stella

AttachmentSize
faq_188516.patch 14.47 KB

#4

Great - better than my patch.

One thing: I don't think the check for "access taxonomy images" is necessary. If they don't have it, the returned image will be null.

Okay, now to try to remember how to apply a patch...

#5

Good point, I didn't realise that. I've attached a new patch which doesn't do this permission check which you should use in place of the other one. If you've already applied the other one then don't mind, it shouldn't break anything.

You can apply a patch on linux systems like "patch -p1 < foo.patch".

Cheers,
Stella

AttachmentSize
faq_188516_2.patch 14.11 KB

#6

I tried both 2.5 and the -dev release and neither would apply.

#7

Hi Nancy,

I'm not sure why that is, so I've attached a tgz file containing the new faq.module and faq.css. Just copy these over your existing files, but be sure to back them up first!

Cheers,
Stella

AttachmentSize
faq_188516.tgz 10.19 KB

#8

I got it now. Thanks.

It works great - far better than what I had done.

One small thing, if your CSS knowledge is better than mine: Since the pictures can be different widths, the category names don't end up in a straight column. I tried adding a wrapper around the image with a width specified, but that didn't fix it.

Any way - RTBC.

#9

Status:needs review» fixed

Ok checked into CVS, and should be available in the dev release made later today.

Cheers,
Stella

#10

Thanks for doing this. I'm this close || to ready to pull the trigger on my new feature.

#11

CSS question - you'd need to remove the "float: left;" from the img.faq_tax_image in the css file first. You could then add a div around the image and specify a width for that I think.

#12

I believe I did that, but I will try it again.

#13

Okay, I got it working. Here's what I added to my css. I'm submitting a patch to Taxonomy Image to add the wrapper (that way it gets all the places you call it).

.taxonomy_image_wrapper {
  float: left;
  width: 70px;
  margin-bottom: 0.5em;
  padding: 0px 0px 0px 0px;
}

img.faq_tax_image {
  padding: 0px 0px 0px 0px;
}

.faq_qa_description p {
  margin: 5px 0px 0px 0px;
}

.faq .item-list .faq_qa_description a {
  font-size: 100%;
  font-weight: normal;
}

.faq .item-list li a {
  font-size: 120%;
  font-weight: bold;
}

.faq_qa .item-list li a {
  color: chocolate;
  font-size: 110%;
  font-weight: normal;
}

.faq_question a {
  color: #663300;
  padding-left: 20px;
  font-size: 115%;
  font-family: "Times New Roman", Times, serif;
  background-image: url(/files/lullacons/lullacons_pack1/arrow-single-right-red.png);
  background-position: left;
  background-repeat: no-repeat;
}

#14

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

#15

Released in faq 5.x-2.6.

Cheers,
Stella

nobody click here