tags:

views:

355

answers:

1

I'm creating a newsletter content-type that should have its stories linked using a nodereference field. I to have one theme for the stories when they appear in the newsletter, and another when they appear in ordinary views or in their own page.

I have two reasons:

  1. Later I'll want to send the newsletter by mail and I'll have to make all the styling inline.
  2. I want to remove certain links that appear below each node, such as add comment or send to a friend, and have them only for the whole newsletter.

What's the best way to achieve this?

A: 

So how are you outputting the story nodes for the newsletter? Are you calling node_view(node_load($story_nid)) or something from the newsletter.tpl.php? If you were you could add a flag to the node object that you could then check for in the story.tpl, like

$story_node_data = node_load($story_reference_nid);
// can't remember whcih way you would do this: either
$story_node_data->from_newsletter = true;
// or
$story_node_data['from_newsletter'] = true;

then in story.tpl

if ($node->['from_newsletter']){
  //do things
}else{
  //do other things
Andrew
Well, I haven't written a template for newsletter nodes, so it currently uses the default way to theme cck nodereference fields. I'm not sure exactly how to override this to use node_load.
haggai_e
Is making a template(a .tpl.php file) something you are planning to do, or are you hoping to use the default drupal output?
Andrew