I made a views as my default frontpage and added an RSS item with the latest updates from a taxonomy category. I have found that the feed wich will be generated contains a category field wich I don't want to make public. Because I have custom views for categories I want to use my own views and not the default taxonomy ones).
In the RSS feed it looks like this:
Name of the term
It is only visible when looking at the source code of the feed but still, it is made public. Also search engines might discover these URL's and do something with it. The feed has filters for
Node: Published True
Node: Type = MyContentType

I have sorted the feed in updated time, but the RSS feed shows the fields date created time (the sorting works fine, just the date the node first was created is shown as the only date in the feed).

Is there anyway to elliminate these bugs, and to remove the Creator tags from the field?
I have tried any possible filter to get the same output but without any luck..

Comments

Simx0r’s picture

Sorry, forgot the code tags :)

In the RSS feed it looks like this:

<category domain="http://www.domain.com/category/vocabulary/term">Term name</category>
merlinofchaos’s picture

Status: Active » Closed (won't fix)

The 'category' links are just terms that you have placed on the node, and Views conforms to the core standard; i.e, it should be have exactly like core in the terms that it places there.

This is not a bug.

Likewise, the dates are also precisely what core uses in its RSS feed.

At best it's a feature request, because you want it to behave differently.

If you want different RSS behavior, you'll have to write a new RSS style that provides the fields you want in the feed.

mooffie’s picture

(If you want to get rid of the /category/ tags, I believe you can implement hook_nodeapi('view') and there, if build mode is NODE_BUILD_RSS, clear $node->taxonomy. If you're stuck, you may want to ask in the fourms. As Merlin explained, it's not really a Views issue.)

bartclarkson’s picture

I tried the hook_nodeapi approach, but didn't find it to work. In theory, this would have done the trick:

function custom_utility_module_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'rss item':
      $node->taxonomy = NULL;
    break;
  }
}

But, in fact, only the view and alter operations work above, not rss item. So that's no good. You could add some sort of check of the arguments coming from the URL into this function, but I rejected that, because the path conventions that make that work aren't enforceable or necessarily intuitive.

So I went with a theme override. Groan. Copied the views-view-row-rss.tpl.php to my theme directory. Entered the following:

  <item>
    <title><?php print $title; ?></title>
    <link><?php print $link; ?></link>
    <description><?php print $description; ?></description>
    <?php 
    $tag = 'category';
    $revised_elements = preg_replace('#</?'.$tag.'(>|\s[^>]*>)(.+</'.$tag.'(>|\s[^>]*>)|)#is', '', $item_elements);
    print $revised_elements;
    ?>
  </item>

... and we live to see another day.