in order to export someone's personal activity into facebook and other social networks, we needed to customize what content gets pushed out on the rss feed. looking at the views_rss.module code, it calls nodeapi which can modify the node teaser and title. our guiding principle was that this kind of formatting code belongs in the node-type.tpl.php file along with all the other code that handles how a node is to be displayed. sample code below.
module code (repeat the if statement for other types or change to switch/case):
function ourmodule_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
if ($op == 'view'){
if ($node->type == 'eventregistration') {
_phptemplate_callback('node-eventregistration', array('node' => &$node));
}
}
}
node-eventregistration.tpl.php file
<?php if ((arg(2) == 'feed')):?>
<?php
$node->teaser = 'Put custom text to be fed to rss here';
$node->title = 'someone registered for an event';
?>
<?php else: ?>
... snip - standard tpl code
our strategy is to provide a means for users to export their activity from our site to their facebook profile via imported blog/rss feed. unfortunately, that functionality is broken right now, but it HAS to get fixed someday, right?
to do this, we have a simple view that gets teasers of all the content types we want to include in the 'activity' stream for a particular author as an argument, e.g. my_activity/63 gets the activity for user 63. my_activity/63/feed gets the rss feed for the view.
then we customize the tpl of each content type to display the proper text around the content depending on its context - e.g. when viewing on the user's home page, when viewing via rss feed, when viewing in an organic group, etc.