hi, thanks for this cool module.

i tried modifying the bluemarine node.tpl.php to get this to work.

I've uploaded a taxonomy image, given access permissions to view it, but when i place this bit of code into the template file, i don't see any image on the node, nor do i see anything in the html source of the page from the browser:

 taxonomy_image_display($term->tid

I'm no php man (yet), but this was all i could guess to do from the instructions.

thanks! much appreciated for this mod. :-)

Comments

satos’s picture

Is it possible to create an URL with image? (xtemplate, 4.7.)

paddy_deburca’s picture

I manually updated the function taxonomy_image_display in the taxonomy_image module to replace the image with a hyperlinked image.

return "<a href='?q=taxonomy/term/$tid'><img src='$current->url' width='$current->width' height='$current->height' alt='$current->name' $tags /></a>";

Paddy.

cybe’s picture

Thanks paddy! It works great

I'm wondering what to use instead of "$tid" to get the proper url_alised categories such as http://site/cars instead of http://site/taxonomy/22 please??

paddy_deburca’s picture

You need to update the taxonomi_image module to use the url() function.

<?php
  $path = url("taxonomy/term/$tid");
  return "<a href='$path'><img src='$current->url' width='$current->width' height='$current->height' alt='$current->name' $tags /></a>";
?>

Hope it works for you,

Paddy.

Leeteq’s picture

Practical if this module would be configurable in terms of using taxonomy/term/23 _or_ the term name as URL.

The http://drupal.org/project/pathauto module (manually too...) can be used to make path aliases also for taxonomy.

rentex’s picture

Version: » master

So could anybody please paste some example code (containing the neccesary changes) on how to get this module working with PHPTemplate Themes?

rentex’s picture

Priority: Normal » Critical

upsey daysey, the version (version setting for this issue) was automagically set to CVS.
Putting it back to what it originally was, since PHPTemplate has a completely different versioning.

rentex’s picture

Title: 4.7.2 and bluemarine - correct taxonomy_image code to insert into node.tpl.php » Which code do I need to insert into node(page).tpl.php in order to display tax-imgs? [4.7.2(n) and bluemarine (PHPTemplate)]

doh sorry forgot to do what I intended in previous post

wmostrey’s picture

foreach (taxonomy_node_get_terms($node->nid) as $term) {
echo "<a href=\"".base_path()."taxonomy/term/".$term->tid."\">".taxonomy_image_display($term->tid, " alt='$term->name'")."</a>";
}
rentex’s picture

Thanks for the prompt reply, but where do I actually paste this piece of code?

I pasted it in node.tpl.php and also in page.tpl.php right after title, but the image wouldnt display.
Any additional steps that are neccesary?

wmostrey’s picture

It should go in node.tpl.php right below

, or just wherever you want the image to show up.
MikeyGYSE’s picture

Okay I've got the code working in Node.TPL.php:

    <span class="submitted"><?php print $submitted?></span><span class="taxonomy"><?php
foreach (taxonomy_node_get_terms($node->nid) as $term) {
echo "<a href=\"".base_path()."taxonomy/term/".$term->tid."\">".taxonomy_image_display($term->tid, " alt='$term->name'")."</a>";
}
?></span>
    <span class="taxonomy"><?php print $terms?></span>

Now that shows as:

http://alphaone.gyse.org.uk/page_tag/errors_and_maintenance

How do I get the "Submitted By" and "Taxonomy Terms" to show to the right of the image, on two separate lines?

MikeyGYSE’s picture

Priority: Critical » Minor
Status: Active » Fixed

Forget the last bit, fixed it :-)

As we've got the code to display the image I'm going to set this to fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)