4

What is the best way to remove the post date from a views created RSS feed? I have a calendar that I have created a feed for, but it is being sorted by a cck date value, making the post date not necessarily accurate.

Is there an easy way to remove this from within views (D6), or would this need to be a template change?

0

2 Answers 2

3

This approach should work. I've tried it in the past and it did exactly what I needed.

Quoted from the above-linked comment:

Put views-view-row-rss.tpl.php in your theme directory

and replace print $item_elements;

with

$item_elements = preg_replace('<pubDate>.*</pubDate>', '', $item_elements);  // removes pubdate
$item_elements = preg_replace('<dc:creator>.*</dc:creator>', '', $item_elements);  // removes author
$item_elements = preg_replace('<category .*</category>', '', $item_elements);  // removes terms         

$item_elements = preg_replace("!^\s+(\D)!m", "\\1", $item_elements);  // removes some blank lines

print $item_elements; 
1
  • I just tried the patch to views-view-row-rss.tpl.php in Drupal 7 and it works perfectly.
    – user12241
    Commented Dec 20, 2012 at 21:54
0

I did something like this about two years ago, so it is possible that things have improved since.

From memory I think you need to do a template change for this kind of thing in views rss feeds. It was not as flexible as it could be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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