Display image only on front page
pvanderspek - August 28, 2007 - 17:41
| Project: | Taxonomy Image |
| Version: | 5.x-1.0-beta1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I've a bunch of news items on my frontpage. I want to use taxonomy image to visually aid the visitor to see to which category a news item belongs. Preferably I would only want to show the taxonomy image on the front page and not on the page of the news item itself. Is it possible to do this.
Ideally, I would like to use functionality similar to what is provided for blocks and views, i.e. provide a list of pages on which (not) to show the image or a php-block which returns a boolean.

#1
Restricting to the front page is straightfoward. I am guessing you have added the approriate code to display the image in node.tpl.php. In this case you can something like this
<?phpif ( $is_front ) {
// Code to display image
}
?>
The variable $is_front is true when the node is being displayed on the front page of the site. A more general solution (i.e. provide a list of pages on which (not) to show the image) would be more involved.
#2
I should've thought of that myself. Anyway, the general solution might be a useful feature in a future version.
#3
Unless someone can come up with a compelling reason why this is not better handled in the theme, I don't think this is within the original intent for this module.
#4