I have created a view to appear in a block and I want to attach an RSS feed. I added an RSS feed, attached it to the block (in the same view obviously) and

a. The $feed_icon does not have a value so doesn't print anything out
b. If I manually navigate to the URL of the feed the browsers say its invalid, Google chrome provides this error...

This page contains the following errors:

error on line 3 at column 6: XML declaration allowed only at the start of the document

Any help?

Thanks
Will Eaton

CommentFileSizeAuthor
#5 recent_posts.txt4.73 KBwilleaton
#3 view-feed.jpg31.71 KBwilleaton

Comments

merlinofchaos’s picture

What's on lines 1 and 2?

merlinofchaos’s picture

I'm also unable to reproduce the feed icon not appearing on the block issue. That's working flawlessly on my system.

willeaton’s picture

StatusFileSize
new31.71 KB

I cant even give you a url to check im afraid because its not live. Im not sure whats on line 1 or 2 because it doesnt show the <?xml line when looking through the browser. I attach a screen dump of the view to see if you can see an issue.

p.s. I have created tpl files for this view and each field but I have literally copied and pasted all lines from what the view generates for me if that helps.

Thanks
Will

merlinofchaos’s picture

You shoudl be able to right click on the RSS link and download it to get the raw RSS. I need to see that.

willeaton’s picture

StatusFileSize
new4.73 KB

Attached xml file

akalsey’s picture

You have two blank lines at the top of the feed. Something is inserting blanks before Views even starts to work.

The most common cause of this is a blank line at the end of a module. When PHP includes a module, any blank lines that aren't in a php block (<?php ... ?>) are included as output to the browser. For this reason, Drupal coding standards say that modules should not include the final closing ?>

Look through the modules you have installed and see which one ends in ?> -- removing that line or disabling that module should fix this issue.

merlinofchaos’s picture

The most common culprit here is often template.php but you should just generally grep for ?> to see where it might appear. It's also possible to have inadvertant linespace prior to the <?php tag (which is another common issue in template.php) but it's less likely.

merlinofchaos’s picture

Status: Active » Fixed

I'm reasonably sure this is not actually a Views problem at this point.

willeaton’s picture

Thanks guys! Ill look through now

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.