I don't really like to have to modify drupal core to do what I need it to do... but I don't see an easy way to do this task:

I have a node that has a teaser field that could be completely different from the body. I use the excerpt module for that. I also want to display the teaser differently if it's used in a slightly different place. By differnetly, I mean that I want to change the text and image that are displayed and I would have to calculate these values from the node.

The way to do this seems to me to add another parameter to the content_type_view() function.

Instead of ($node, $teaser = FALSE, $page = FALSE) for arguments, I would need to use something like ($node, $teaser = FALSE, $page = FALSE, $view_method = 0) so that the function could calculate the correct teaser text.

If there's a better way to do this, enlighten me. I don't see how you can choose an alternate display of a node within the same theme.

Comments

chx’s picture

Use hook_nodeapi and act when op' is view and $teaser is TRUE.
--
Read my developer blog on Drupal4hu.
CVS Delenda Est

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.