I wrote a new function extending function taxonomy_image_display().
The api function taxonomy_image_url() can get a taxonomy image for any URL within the site. I hope you will accept this small addition to the contributed modules of taxonomy image.
The only missing feature here is adding the alt="xxx" and title="xxx" whenever the default image is used at the end of this function.

CommentFileSizeAuthor
#4 taxonomy_image_url.zip2.25 KBpromes
taxonomy_image_url.zip2.2 KBpromes

Comments

nancydru’s picture

I will consider this (even though 5.x is frozen) after you fix some problems:
* No tabs are allowed in Drupal.
* The indentation is not consistent - you have levels coming back out to the left instead of being indented more.

You might want to look at installing the Coder module.

promes’s picture

Hello Nancy,

I am sorry I didn't think of using the coder module. I was told half a year ago this is a must before submitting a new module. But this is my first one to submit to the community.
I am on a tight schedule at this very moment, but I will come back somewhere next week.

PROMES

chasz’s picture

+1

promes’s picture

StatusFileSize
new2.25 KB

I used the coder module. No errors/comments are left.
I don't understand your sentence: "* The indentation is not consistent - you have levels coming back out to the left instead of being indented more.". As far as I know the intentation is correct. Maybe the tabs confused you.
I hope it confirms to the standard now and I hope a lot of people was have fun with my module.

thepanz’s picture

@promes: in Drupal conding standard, no "tabs" (\t) are allowed, replace tabs with two spaces.

promes’s picture

As far as I know I replaced all tabs in the second upload. The Coder module doesn't give any warnings anymore on this version.
So why this remark ThePanz? I cannot find any tab anymore ! Just use the second upload file.

thepanz’s picture

@promes: sorry, I was replying to your question about "The indentation is not consistent".

nancydru’s picture

Status: Active » Needs review
klonos’s picture

taxonomy_image_display() can be used like so: taxonomy_image_display($term->tid) to retrieve the taxonomy image for a term and display it.

taxonomy_image_url() can be used to get a taxonomy image for any URL within the site.

taxonomy_image_get_url() can be used to retrieve the taxonomy image's URL.

What I need is a function, say... taxonomy_image_url_display() that would be used like so: taxonomy_image_url_display($term->tid) and that would retrieve the taxonomy image for a term and display it as well as the term's URL.

In other words, taxonomy_image_display() returns a <img> tag while what I am looking for is a <a> tag with the term's associated image liking to the term's page (taxonomy/term/term-name or category/[vocab-raw]/[catpath-raw] if using pathauto).

Any help? Or should this be an issue of its own?

pomliane’s picture

Status: Needs review » Closed (won't fix)

This version of Taxonomy Image is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.