Closed (fixed)
Project:
Views Node Feed
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2008 at 16:17 UTC
Updated:
19 May 2009 at 20:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
andrewlevine commentedNot at the moment but I will likely be asked to port this for work in the next few weeks. Patches accepted in case that's your thing :)
Comment #2
tizzo commentedI guess I needed this before you did! Updating for the new views 2 API required a pretty significant rewrite. I tried to stay as faithful to the original as possible.
One improvement is that the D6 version no longer requires an argument (/node_feed) in order to load the feed. Simply creating a feed in the UI with the style type "Views Node Feed" and specifying preferred feed in the style settings is all that is necessary. This allows you to create feeds that end in .xml (which can be handy when working with some existing Flash widgets).
This module currently exposes both $node and $nodes to the views_node_feed template (I dropped $type) and as such it builds fully loaded nodes before using the template to generate the output for each node (so it only works with nodes).
Given that views 2 can make lists of things that aren't nodes (and that they might be useful as XML/JSON) perhaps this should be reworked and it should be left to users to perform a node_load (or user_load as the case may be) in order to allow lists to be made from users, etc). Doing this would, however, also mean that the name is somewhat outdated (it could make a views feed of things that aren't nodes).
Perhaps this module should be retitled "views_template" (a less clever derivation of the contemplate naming)?
This patch should be run from inside views_node_feed directory.
Comment #3
andrewlevine commentedtizzo, you are great! Thanks for this, I will make sure I look at this and get you feedback when I'm at work on Friday, no matter what my boss says. (sorry suzi, if you are looking at this)
Comment #4
andrewlevine commentedHey, I committed this to a development branch. Thanks again
Comment #5
jenniferism commentedsubscribe
Comment #6
jjjames commentedThis looks cool thanks
Comment #8
davexd commentedWhen I change my Feed Style to this "Views Node Feed", I'm then asked to configure the style. However, I can only see a label: "Views Node Feed Template" and an empty drop down box.
eg. http://img.skitch.com/20090104-p9p9djjthyx8cihcar254kc8se.jpg
Comment #9
tizzo commentedYou need to create a views node feed first at admin/settings/views_node_feed.
You're right though, it really should just give you a link to create one and not render an empty list. I'll roll a patch and update.
Comment #10
guillaumeduveauHUGE module ! Tizzo's port to D6 works perfectly, looking forward for a D6 stable release. Maybe at least a few views node feed templates like the XML one ? Which would resolve Davexd's issue.
PS : why is it impossible to choose 6.x-1.x-dev for the Version field ?
Comment #11
jjjames commentedThanks tizzo for making this patch. It would be great if someone could roll this out into an official D6 module. It's one of the missing links of D6 :)
I appreciate your guys work!
Comment #12
gdoteof commentedI can't officially add it, but this is the patch applied (I also added the version number to the .info file) and should work like any other module for drupal 6.
thanks, this solved my views->xml problem pretty elegantly.
edit: i can't seem to edit the file but it should probably be considered a -dev version and it isn't labeled as such
Comment #13
jjjames commentedwow great! now i just need to learn how to add cck fields to the output! (any help appreciated)
Comment #14
gdoteof commentedsomething like $node->field_name_of_cck_field[0]['value'];
Comment #15
no2e commentedsubscribed
Comment #16
andrewlevine commentedgdoteof, Just so you know, you can get the nightly snapshot of the Drupal 6 version here: http://drupal.org/node/343850
If there are any bugs, please open those separately.
Comment #17
jjjames commentedThanks...but it doesn't work for me :(
my field name is: field_image
and it's blank when i put the code:
print $node->field_image[0]['value'];do i literally put the 0 and 'value' inside the brackets? or do i have to replace them with some logic?
I would appreciate any help.
Thanks!
Comment #18
andrewlevine commentedDo
to see what fields you have available.
Comment #19
jjjames commentedThat's great info! Here's what came up.
object(stdClass)#48 (30) { ["nid"]=> string(1) "2" ["type"]=> string(8) "feedtest" ["language"]=> string(0) "" ["uid"]=> string(1) "1" ["status"]=> string(1) "1" ["created"]=> string(10) "1234499544" ["changed"]=> string(10) "1234499544" ["comment"]=> string(1) "2" ["promote"]=> string(1) "1" ["moderate"]=> string(1) "0" ["sticky"]=> string(1) "0" ["tnid"]=> string(1) "0" ["translate"]=> string(1) "0" ["vid"]=> string(1) "2" ["revision_uid"]=> string(1) "1" ["title"]=> string(10) "test image" ["body"]=> string(19) "please work in rss?" ["teaser"]=> string(19) "please work in rss?" ["log"]=> string(0) "" ["revision_timestamp"]=> string(10) "1234499544" ["format"]=> string(1) "1" ["name"]=> string(5) "user1" ["picture"]=> string(0) "" ["data"]=> string(6) "a:0:{}" ["path"]=> string(18) "content/test-image" ["field_image"]=> array(1) { [0]=> array(10) { ["fid"]=> string(1) "1" ["list"]=> string(1) "1" ["data"]=> array(0) { } ["uid"]=> string(1) "1" ["filename"]=> string(11) "Photo 1.jpg" ["filepath"]=> string(31) "sites/default/files/Photo 1.jpg" ["filemime"]=> string(10) "image/jpeg" ["filesize"]=> string(5) "72396" ["status"]=> string(1) "1" ["timestamp"]=> string(10) "1234499532" } } ["last_comment_timestamp"]=> string(10) "1234499544" ["last_comment_name"]=> NULL ["comment_count"]=> string(1) "0" ["taxonomy"]=> array(0) { } }
Can you please help my sorry-ass figure out how to display the image path in the feed?!
Thanks alot :)
Comment #20
jjjames commentedActually, I'd also really like to understand what all of this code means. Is there a reference so that I can decipher this useful info?
Comment #21
andrewlevine commentedsee http://us2.php.net/var_dump
you probably want something like:
Comment #22
jjjames commentedThanks that worked great! you are the man!
Just a quick question, how do I put the site's root in front of the image path?
right now it's sites/default/files/Photo 1.jpg
i want it to be: http://mysite.com/sites/default/files/Photo 1.jpg
I really appreciate your help!
Comment #23
jjjames commentedSorry to bother you again...but how would I display the comments? I have a comment but a var dump shows just this:
object(stdClass)#51 (30) {
["nid"]=>
string(1) "3"
["type"]=>
string(8) "feedtest"
["language"]=>
string(0) ""
["uid"]=>
string(1) "1"
["status"]=>
string(1) "1"
["created"]=>
string(10) "1234733529"
["changed"]=>
string(10) "1234733529"
["comment"]=>
string(1) "2"
["promote"]=>
string(1) "1"
["moderate"]=>
string(1) "0"
["sticky"]=>
string(1) "0"
["tnid"]=>
string(1) "0"
["translate"]=>
string(1) "0"
["vid"]=>
string(1) "3"
["revision_uid"]=>
string(1) "1"
["title"]=>
string(12) "second image"
["body"]=>
string(18) "this is the body"
["teaser"]=>
string(18) "this is the body"
["log"]=>
string(0) ""
["revision_timestamp"]=>
string(10) "1234733529"
["format"]=>
string(1) "1"
["name"]=>
string(5) "user1"
["picture"]=>
string(0) ""
["data"]=>
string(6) "a:0:{}"
["path"]=>
string(20) "content/second-image"
["field_image"]=>
array(1) {
[0]=>
array(10) {
["fid"]=>
string(1) "2"
["list"]=>
string(1) "1"
["data"]=>
array(0) {
}
["uid"]=>
string(1) "1"
["filename"]=>
string(12) "Photo 44.jpg"
["filepath"]=>
string(32) "sites/default/files/Photo 44.jpg"
["filemime"]=>
string(10) "image/jpeg"
["filesize"]=>
string(5) "68312"
["status"]=>
string(1) "1"
["timestamp"]=>
string(10) "1234733529"
}
}
["last_comment_timestamp"]=>
string(10) "1234733529"
["last_comment_name"]=>
NULL
["comment_count"]=>
string(1) "0"
["taxonomy"]=>
array(0) {
}
}
thanks again for your help :)
Comment #24
gdoteof commentedgdoteof, Just so you know, you can get the nightly snapshot of the Drupal 6 version here: http://drupal.org/node/343850
If there are any bugs, please open those separately.>>>
I get an access denied on that node?
Comment #25
andrewlevine commentedlooks like a glitch occured with the packaging system. republishing to see if it repackages...
Comment #26
chipway commentedHi,
could you upload a d6 dev version so we could be many testing it ?
Thank you
Comment #27
andrewlevine commentedcwdrup, I'm trying...I have an issue filed with the Drupal infrastructure team
Comment #28
espry commentedAny progress? It still seems impossible access the 6-version. Could you pls post elsewhere? I really need this v. useful module. Thanks.
EDIT: I realize that the version attached above works.
Comment #29
andrewlevine commented@espry: I am working on this. I got the node deleted by a drupal.org admin and recreated it, hopefully it will show up by tonight. If not I will have try to get it debugged by an drupal.org admin :\ Hopefully I'll get things sorted out soon.
Comment #30
andrewlevine commentedHey everyone. dww fixed the file issue and you should now be able to download the DRUPAL-6 version from the main project page: http://drupal.org/project/views_node_feed
Comment #31
tizzo commentedRight now making a list of comments is possible but probably a bit tricky. In your snippet for the rendering of each node I think you would need to do an actual database query to get the comments for the node and then loop through them to add them as child elements within your node ... but it's going to be sort of non-trivial as I don't think there's an API call to grab all comments for a given node without rendering them into html. ...though there probably should be...
If you get into something this involved its probably a good idea to roll it into its own module, you really don't want too much php code floating around in your database.
That said, something LIKE:
would probably work for you.
Again, I sort of think that we should update this module so that it can make listings of things other than nodes now that views is flexible enough to base its queries on something other than the node table but that probably would not help with this particular use case.
Comment #32
tizzo commentedComment #31 above was created by clicking the reply link to superjames's question, as was this one. Strange.
Comment #33
Anonymous (not verified) commenteddoes the D6 version include the taxonomy term view type yet or if not, is that on the roadmap?
i need an xml data view that counts my nodes sorted by taxonomy term.
i can't display any variables yet.