Hi there,

I've followed the instructions in the ReadMe file but I'm not sure what I need to put into the 'Node template' or 'Wrapper Template' to get an XML feed of everything in the view. At the moment all I get is the Node Title on the page.

Any help would be fantastic...what I want to export is an XML file of all the fields available in the View.

Also, in the view, I've selected the View Type - Views Node Feed: Node Feed. Is that the correct thing to do?

Also, in the Argument section should the default be Display All Values or should it be something else?

Sorry if these are obvious questions...I'm just trying to grasp it.

thanks

thomas

Comments

andrewlevine’s picture

I've followed the instructions in the ReadMe file but I'm not sure what I need to put into the 'Node template' or 'Wrapper Template' to get an XML feed of everything in the view. At the moment all I get is the Node Title on the page.

You might want to put something like this in your wrapper template (typo referenced in comment 8 has been fixed):

<?php print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; ?>
<nodes>
***VIEWS_NODE_FEED_ITEMS***
</nodes>
<?php drupal_set_header('Content-Type: text/xml; charset=utf-8'); ?>

Your node template might be something like this:

<node id="<?php print $node->nid ?>">
<title>"<?php print $node->title ?></title>
<body>"<?php print $node->body ?></body>
</node>

As for the rest of your questions, don't worry about the other options, they are mostly ignored. Just follow the README and you should get what you want.

vlooivlerke’s picture

Status: Active » Postponed (maintainer needs more info)

I followed the readme and this top part but end up with a blank screen when i visit the /node_feed part of the url

I added node ID, Title, and body fields to my view.

When I create a feed under settings/node_feed and press submit i get this error.

* warning: Illegal offset type in isset or empty in /home/.../public_html/includes/bootstrap.inc on line 744.
* warning: Illegal offset type in /home/.../public_html/includes/bootstrap.inc on line 745.
* warning: Illegal offset type in /home/.../public_html/includes/bootstrap.inc on line 748.

But in my view, it shows as an option to select (xml_feed)

This module looks very exiting :)

MJL-1’s picture

I'm seeing the same error and "no feed" results that VlooiVlerke noted on October 7, 2008 at 09:35.

Please shed light on what is causing this error. After adding a new feed at admin/settings/views_node_feed I'm getting this:

* warning: Illegal offset type in isset or empty in /home/c0004/public_html/netfeeder/includes/bootstrap.inc on line 758.
* warning: Illegal offset type in /home/c0004/public_html/netfeeder/includes/bootstrap.inc on line 759.
* warning: Illegal offset type in /home/c0004/public_html/netfeeder/includes/bootstrap.inc on line 762.

I'd like to create a feed using "Node template" with php print statements similar to the following:


<node id="<?php print $node->nid;?>">
<title><?php print $title;?></title>
<body><?php print $body;?></body>
</node>

Is the above syntax correct?

Please post actual working sample code for "Node template" using each of these variables: $view, $nodes, $node, and $type

Thanks :-)

tizzo’s picture

I believe the illegal offset error resulted from leaving t() out of one of the lines of code, I have submitted a patch here.

The error only causes problems with the confirmation message, it should not affect the functionality of the module.

andrewlevine’s picture

MJL and VlooiVlerke,

Could you try checking out the newest CVS version of the module from the DRUPAL-5 branch and seeing if this problem still exists? I have applied tizzo's patch from comment #4.

Thanks!

vlooivlerke’s picture

thanks

andrewlevine’s picture

VlooiVlerke,

Can you confirm the problem no longer occurs in the current DRUPAL-5 branch?

Thanks!

cosmogenesis’s picture

There's a missing opening single quote in the xml doctype declaration in the above wrapper code that would result in a blank page.

andrewlevine’s picture

cosmogenesis was right, thanks! Although it wasn't a typo but rather what seems to be a bug with the php highlighting in the issue queue.

I have updated the code above to use double quotes instead of single quotes and it seems to print properly now.

patbranch’s picture

I got that error with version 5 that I just downloaded.

laurentmonos’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Component: Documentation » Code

Really an awesome module... there's just one thing I can't figure out how to do. How do I get view relationships working? I mean, how can I make it output to my xml feed?
Any ideas are greatly appreciated.