Is it ok to have inline styles in an RSS feed?
Im making an RSS feed for a site which uses content that itself has been imported and contains inline styles. Will these be used or ignored by readers, and could they cause any other issues?
Thanks
RSS feed isn't really meant to be styled in any way, readers style them for themselves. They can contain HTML tags in places like titles or descriptions, however adding tags in other places might cause some issues.
See the W3 rss feed tutorial
Related
Many feed readers seem to use different tags for thumbnails. What are some common ways of specifying thumbnails?
So far, I know about the enclosure tag, the media:thumbnail tag, embedding images directly in the item description, and using the og:image meta tag. What are ways are there?
Tehcnically, the only way to do it with pure RSS is <enclosure>. Now, the greatness of RSS is that it's (almost) XML, which means that you can extended with namespaces... whether they are existing namespaces (like MediaRSS) or completely custom ones.
As to what you should do:
try to avoid creating your own namespace because it's unlikely everyone else will do the work to support it.
Use MediaRSS: (media:thumbnail) specifically if you need it for more than just the thumbnail (like a larger image, or other media elements).
If you only need <enclosure> then, just use plain RSS: simpler is better!
Is it possible to remove the markup wiki language from the RSS feed and only show the article content?
Because I am using different template like info-boxes etc. and when people click the RSS link it show all the template markup and all the unnecessary coding that people don't really care. I been trying to find a good tutorial or help where I can accomplish this.
Screentshot
As Dereckson says, no, it's not possible. Feeds are just an alternate way to consume recent changes.
The ability to consume recent changes in parsed format essentially equates the feature request for visual diffs (HTML diffs). Will be possible at some point with Parsoid.
Im making a normal RSS feed for my website. I need to include simple html formatting in the description eg paragraphs, line breaks, lists, etc. To do this I need to wrap the description content as CDATA.
The issue with this is that when I validate my feed the content of the CDATA is ignored. So although the feed validates, I dont actually know if everything is ok or not.
How can I find out what markup will likely be read ok by the various RSS readers?
Can I use whatever markup I would happily put in a website? How about inline styles? Or is more like designing html emails? Thanks
RSS files are XML Formatted plain text, I think that's the only standard you can rely upon.
I think most Syndicators look like they're handling HTML in RSS as they simply download the linked article when you choose the header.
If you're looking to embed rich content, then you may well be better investigating Atom instead of RSS.
Have a look at this S/O question: Which is better for encoding HTML for RSS?
I'm trying to incorporate a google news feed in my website (Using the built-in SimplePie functionality of WordPress).
However, the default feed gets rendered in a strange table structure. Sure enough, when I inspect the feed XML, I see that Google News has a whole bunch of table html as its 'description' element, complete with embedded styles, etc (See this example)- essentially dictating how the feed must be displayed, and not allowing for any effective css based customization.
This seems really dumb- can anyone help explain what is going on, or at least agree with me that this is just a terrible feed architecture?
Feeds often include html tags, as many (most?) readers will handle and use them, and that way the RSS provider can have some nice looking output in the reader, as you've guessed. (I prefer flagging it as CDATA unless it's proper xhtml, as it's not valid xml/rss otherwise). It's not in the original spirit of RSS perhapts, but the Google feed is just an extreme example of common practice. As per your problem, does strip_htmltags help (simplepie.org/wiki/reference/simplepie/strip_htmltags)?
On my blog I use some CSS classes which are defined in my stylesheet, but in RSS readers those styles don't show up. I had been searching for class="whatever" and replacing with style="something: something;". But this means whenever I modify my CSS I need to modify my RSS-generating code too, and it doesn't work for a tag which belongs to multiple classes (i.e. class="snapshot accent"). Is there any way to point to my stylesheet from my feed?
The popular RSS readers WILL NOT bother downloading a style sheet, even if you provide one and link to it using <?xml-stylesheet?>.
Many RSS readers simply strip all inline style attributes from your tags. From testing today, I discovered that Outlook 2007 seems to strip out all styles, for example, even if they are inline.
Good RSS readers allow a limited set of inline style attributes. See, for example, this article at Bloglines about what CSS they won't strip. From experimentation, Google Reader seems to pass through certain styles unharmed.
The philosophy of RSS is indeed that the reader is responsible for presentation. Many people think that RSS should be plain text and that CSS in RSS feeds is inappropriate. It's probably not appropriate to impose a different font on your RSS feeds. However, certain types of content (for example, images floated on the left, with captions positioned carefully) require a minimal amount of styling in order to maintain their semantic meaning.
The point of RSS is to be display agnostic. You should not be putting style attributes on your feed.
I found this blog post that describes how to add style to your RSS feed.
Because RSS is (supposed to be) XML, you can use XML stylesheets.
http://www.w3.org/TR/xml-stylesheet/
The purpose of an RSS feed is to allow the easy transmission of content to places outside your site. The whole idea is that the content within the feed is format-free, so that it can be read by any piece of software. The program that is reading the your feed is in charge of how to present it visually. For example, if you had a website that read RSS, you would want to parse the feed into HTML, and style it that way. However, if you were building a desktop application to read the feed, you would implement the formatting quite differently.