Closed (fixed)
Project:
Taxonomy Image
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
19 Jan 2005 at 20:28 UTC
Updated:
16 Aug 2009 at 10:20 UTC
I would like to recommend the following update to PHPTemplate.engine to support ALT and TITLE tags for taxonomy images.
To support taxonomy_image the phptemplate_node function starts with the following lines:
if (module_exist('taxonomy') && ($taxonomy = taxonomy_link('taxonomy terms', $node))) {
if (module_exist('taxonomy_image')) {
foreach (taxonomy_node_get_terms($node->nid) as $term) {
$images[] = taxonomy_image_display($term->tid, "alt='Category: $term->name' title='Category: $term->name'");
}
}
}
else {
$taxonomy = array();
}
By adding the "alt='Category: $term->name' title='Category: $term->name'" parameter to the call to taxonomy_image_display, the taxonomy images have a nice information tab when the mouse hovers over the image.
Both the ALT and the TITLE should be used to support as many browsers as possible.
Paddy.
Comments
Comment #1
harald.walker commentedCould you explain, where in phptemplate you changed it and how your template file looks like? The module itself only comes with the marvin_2k.patch.
Comment #2
harald.walker commentedin other words:
If I change the code in the phptemplate_node function, I will get many taxonomy images on teaser pages. Only on node page this works as I would expect.
That's why I first tried it in phptemplate_page but I did't get very far.
Comment #3
harald.walker commentedI added following code to the phptemplate_page function. It is the same code that is being used by Taxonomy Context for the navigation menu.
and add
to the array
$taxonomy_image can then be displayed in page.tpl.php. If $taxonomy_image is null a default image is being shown.
Comment #4
jeremy commentedIt would be helpful to include actual patches, rather than snippets.
Also, these changes are not for the taxonomy image module, but for phptemplate. If you are hoping to get this merged, you'll need to select the correct project. If you do not hope to get them merged, you can leave them here so that other taxonomy_image module users can find them and apply them themselves.
Comment #5
fixweb@chattabene.fixweb.it commentedI'm added code to support Multi Tax Image
and have Link on tax image.
See on http://www.fixweb.it/
Thanks for your work.
Comment #6
fixus971 commentedWith new Drupal 4.7 I'm updated my tax img code
so now can separate Categories from Arguments
My node pushbutton theme now is:
Comment #7
nancydruSubmit an actual patch against 5.x with a good use case, please.
Comment #8
nancydruThe ALT and TITLE attributes are provided by the base module without need for theme fiddling.