Hello,
I am trying to generate a view that lists information (including taxonomy terms) related to nodes of a specified type. The page display displays the results as desired, but the RSS feed doesn't include taxonomy terms. In addition, if I run the query generated by views module, no taxonomy terms are included. What's going wrong here?

I have used filters to limit results to specified node type (forum_thread). I am using Fields to display node fields and taxonomy terms information.

The query generated is

SELECT node.nid AS nid,
node.title AS node_title,
node_comment_statistics.comment_count AS node_comment_statistics_comment_count,
node.sticky AS node_sticky
FROM node node
LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid
WHERE node.type in ('forum_thread')

Note that it doesn't refer to any of the taxonomy tables. In any case, the page display is

Subject: Test thread gas
Sticky: No
Nid: 2
Fuel:
Gas
Human
Subject: Post wheels
Sticky: No
Nid: 3
Fuel:
Gas
Electric

Note that it includes taxonomy terms associated with the nodes from "Fuel" vocabulary. If I run the query generated on the mysql database (on webmin) or if I see the feed generated by the view, neither of them contain the taxonomy terms.

1. Where do the taxonomy terms come from in the page view?
2. How can I have them show up in feed as well?

Thanks in advance.
Vinay

Comments

mooffie’s picture

if I run the query generated by views module, no taxonomy terms are included
[...]
it doesn't refer to any of the taxonomy tables.

The 'all terms' field does its work in the rendering stage. This stage happens after the main query, that you saw, finishes executing. This is true for most 'many to one' fields that are grouped (e.g. the 'user roles' field) because the alternative, pulling them in the main query, will cause duplicate records.

(You can ask Views to show you queries run in the rendering stage as well.)

The page display displays the results as desired, but the RSS feed doesn't include taxonomy terms.

Note that, for the 'feed' display, 'row style' says 'node'. It doesn't say 'fields'. This means that any fields you include in your view are ignored for this style. This 'node' style has a largely fixed look. Taxonomy terms _are_ included: they're injected into the RSS by the taxonomy module, as {category} tags, which your feedreader perhaps doesn't show you, but you can see them via View's 'preview' feature. If you want the taxonomy terms to show up in the node body instead, you'll have to implement hook_nodeapi('view') or hook_nodeapi('rss item') and modify the node's text. This has little to do with Views itself.