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
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

nevets - August 28, 2007 - 18:04

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

<?php
if ( $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

pvanderspek - August 29, 2007 - 17:17

I should've thought of that myself. Anyway, the general solution might be a useful feature in a future version.

#3

NancyDru - February 7, 2008 - 04:40
Status:active» won't fix

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

NancyDru - February 28, 2008 - 23:42
Status:won't fix» closed
 
 

Drupal is a registered trademark of Dries Buytaert.