The mysite_teaser function from what I understand is only supposed to return the teaser of the node, but in my case it returns the entire node, complete with the "submitted by" (post information) even though that is disabled and a content template has been created for that node type. These are all cck nodes.

Comments

agentrickard’s picture

Status: Active » Closed (works as designed)

It should return the teaser element of the node -- but does not obey your custom template files. This is a documented limitation -- see section 5.4 of README.txt:

Note: MySite does not use PHPTemplate for node formatting.  Custom node theming
done at the template layer will not appear to MySite users.  See the API
documentation for information about changing node templates in MySite.

This is because MySite tries to treat nodes and non-nodes as the same type of object.

The function in question for generating the teasers is:

/**
 * Generate a fully-themed teaser element for MySite content items.
 *
 * @param $node
 * The $node object created by node_load().
 * @param $theme
 * The theme function to invoke when rendering this teaser element.  This variable
 * allows different type includes to define their own themes.
 * @return
 * The fully themed $teaser to use with MySite pages
 */
function mysite_teaser($node, $theme = 'mysite_teaser') {
  $node = node_build_content($node, TRUE);
  $teaser = theme($theme, $node);
  return $teaser;
}

If your node teasers are not cropped, then the full node is presented.

agentrickard’s picture

You probably want to write your own Format plugin.

See the API. You could run a node_load() on the $item id and then format the output as you see fit.

The 'submitted by' line is line 29 of teasers.theme.

See especially theme_mysite_hook_item() and mysite_type_hook_data() in the API.php file.