Hi!

In content templates module im using templates for blogs, audio, video and other content types.

My question:
Now i need to print the $body inside the teaser for the blog content template, without the read more link, only when the taxonomy is equal to "Something", how can i do this?

I was using and testing this in the text area for teaser, but nothing happens :(


if ( $node->taxonomy[78]->tid ) {
 print $body;
}
else{
 print $teaser;
}

Any help is welcome.
Thanks in advance.

Comments

jrglasgow’s picture

The teaser section doesn't have the body loaded by default, you need to do it like this:

<?php
  if ( $node->taxonomy[78]->tid ) {
    $this_node = node_load($node->nid);
    print $this_node->body;
  }
  else{
    print $teaser;
  }
?>

When you have the taxonomy # 78 it will load the whole node into $this_node then you can print $this_node->body

jrglasgow’s picture

Status: Active » Postponed (maintainer needs more info)

Does this solve your problem?

jrglasgow’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

closing this issue assuming it is fixed