1

I've got a basic blog built on Views 2 on a D6 site, with a couple displays built using the views style plugin 'RSS Feed'. Our content team frequently posts various embeds using iframes or flash objects which work fine, except when viewed through an RSS reader where these items (and other basic HTML tags like or ) are stripped out.

I've already tried creating a separate template for my view from the default template:

  <item>
    <title><?php print $title; ?></title>
    <link><?php print $link; ?></link>
    <description><?php print $description; ?></description>
    <?php print $item_elements; ?>
  </item>

but I'm not able to modify the $description variable or catch it before the input format filter is applied. What is the best way to do this?

1

Figured this out -- client request was to not eliminate any of the html markup (embeds, videos, emphasis tags, etc.) even though some of the RSS readers would continue to strip it out on their own. I worked through this by creating a views-view-row-rss.tpl.php for my specific view and then adding the following code in:

<? 
 $index = $variables["view"]->row_index;
 $nid = $variables["view"]->result[$index]->nid;
 $node = node_load($nid);

 $teaser = check_markup($node->teaser);

 $description = "<![CDATA[".$teaser."]]>";

?>
  <item>
    <title><?php print $title; ?></title>
    <link><?php print $link; ?></link>
    <description><?php print $description; ?></description>
    <?php print $item_elements; ?>
  </item>

Hope this is helpful to someone else, welcome any suggestions on improving this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.