Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I add a node item to my rss output?
this is the normal item i get:
<item>
<title>some kind of title</title>
<link>www.somelink.com</link>
<description>some description, etc etc</description>
</item>
but I want to add extra nodes inside the items:
<item>
<title>some kind of title</title>
<link>www.somelink.com</link>
<description>some description, etc etc</description>
<extranode1>extra data</extranode1>
< extranode2>extra data</extranode1>
etc etc
</item>
if I add stuff in the rss template it becomes available inside the <description> ...
like <?php print $node->images[preview] ?> ...
any help ? :-)
Comments
Comment #1
jorisx CreditAttribution: jorisx commentedSo I can't add a custom node in my items rss file?
because now I have to parse the body field for all my custom variables ... which is not really handy
anny help?
Comment #2
drywall CreditAttribution: drywall commentedI'm having this same problem. Contemplate bills itself as giving "full control" over how Drupal outputs nodes but for RSS it only seems to affect what gets dropped into the <description> tag.
Comment #3
jrglasgow CreditAttribution: jrglasgow commentedConTemplate (Content Template) is to be used as special formating for content inside the wrapper that is provided by the theme. In the Garland Theme node.tpl.php file you will find a div
this is used for the teaser and the body.
For rss Contemplate was designed just to modify the content in the description tag, I'm sure what you are looking for can be accomplished, but I would classify it as a 'feature request' not a 'bug report'
Comment #4
drywall CreditAttribution: drywall commentedYou're probably right that it should be classified as a feature request. I guess I consider(ed) it a bug simply because in the Contemplate admin it says, "Please note that by creating a template for this content type, you are taking full control of its output" and to me "full control" != "just the description tag".
Comment #5
jorisx CreditAttribution: jorisx commentedOkey feature request it is ...
so what we need is a way to create our own tags in the rss so we can take "full control" of our output :)
Any ideas on how to hack this in to this module?
Comment #6
jrglasgow CreditAttribution: jrglasgow commentedtake a look at contemplate 5.x-2.0
Comment #7
youngbuddha CreditAttribution: youngbuddha commentedHi all,
With Contemplate 6.x-1.x-dev (2008-04-22) and Drupal 6.2, I am seeing the same behaviour as the original poster, i.e the description tag is clobbered but additional XML elements don't show up. Should I be using the older 6.x-0.7 release?
I have inserted the following PHP code into my "affect RSS block", with the checkbox enabled.
Thanks for your time.
Comment #8
jorisx CreditAttribution: jorisx commentedCool, this works really well with 6
I only installed contemplate (no other cck modules)
and I needed the image urls in the xml,
so I added this in the xml template:
and check it at your-website/rss.xml
Comment #9
hpk CreditAttribution: hpk commentedI am using the above code to output custom fields (cck 6.x-2.0-beta) the code is working however the description field is empty (thats why the $body variable). What can I do to fix this?
Comment #10
jorisx CreditAttribution: jorisx commentedI think I had the same problem, i've added this :
the body is an array, so you need to get the some value ...
(i'm not really into php, just copy/past and hacking my way trough it)
so for your xml it would be:
Comment #11
sillygwailoThe $xml_elements array works great for adding elements in version 2 of the Drupal 5-compatible module. What I'd like is to be able modify the existing elements. So for example, instead of the
element using the URL of the post, I'd like it to have the URL I'm pointing people using a Link field.
Right now if you add the following code:
it will add another
element to the end instead of modify the existing one. Is replacing an RSS feed's elements possible?
Comment #12
bradjones1I'll throw in my support for this kind of behavior; the teaser and body contemplate fields effectively override the entire output of the node in a particular setting; I'd like to do the same with each node's rendition in an RSS feed.
Like Richard, I'd like to point RSS readers to a link, rather than bounce them off a node view on our site that doesn't really get them to where they need to go.