--- contemplate.module Thu Oct 19 14:22:54 2006 +++ contemplate.module Sun Nov 12 13:57:43 2006 @@ -85,9 +85,12 @@ print "
"; */ case 'rss item': - if ($template = contemplate_get_template($node->type)){ + // Only do this if NOT a CCK managed content type + // and a template is available + if (!content_types($node->type) && $template = contemplate_get_template($node->type)){ if($teaser){ $node->teaser = contemplate_eval($template->teaser, $node); + $node->readmore = (strlen($node->teaser) < strlen($node->body)); } else { $node->body = contemplate_eval($template->body, $node); @@ -98,6 +101,19 @@ } } +/* + * Function called by CCK. + * Alter the created body and teaser + * Other modules can use nodeapi to add content to them + */ + +function contemplate_view(&$node) { + if ($template = contemplate_get_template($node->type)){ + $node->teaser = contemplate_eval($template->teaser, $node); + $node->body = contemplate_eval($template->body, $node); + } +} + /** * Admin page... list out the node types *