HOW TO add CSS for RSS files?

Talk and info about common issues

Moderators: ne_moj, zewa

administrator
Site Admin
Site Admin
Posts: 5930
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO add CSS for RSS files?

Postby administrator » Jun 27th, '13, 13:16

In some browsers (for ex.: in Crome) you may get following errors:
This XML file does not appear to have any style information associated with it. The document tree is shown below.


What that means is that there's no stylesheet present on how to display the page. Stylesheets are only needed for when you want to view it in a browser.
Example of a XML document with a stylesheet: http://www.apphp.com/feeds/rss.xml
It has the same kind of source as a feed, but it has not stylesheet that browsers use to display the page.

So.. it doesn't matter as no one needs to be viewing it in their browser.
Feeds are meant for readers and such, not viewing in a browser. :)

In other words, if you get this notice - it's not error!
But anyway, if you want to add CSS for your RSS files, you may customize the include/RSSFead.class.php, so it will include some king of styles you want.
For example:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" media="screen" href="/{your domain}/styles/style.css" ?>

Return to “ApPHP MicroCMS {HOW TO}”