I gota killer RSS feed, but it contains HTML. I need it to contain html to properly display on other sites. On top, what should I add.. Like addtype or something it wont validate for me. Thanks
You have to convert the special characters to their character entities to get it to validate. I just built an RSS feed creator and had to add in things like this to covert them: $description = str_replace("&", "&", $description); $description = str_replace("<", "<", $description); $description = str_replace(">", ">", $description); PHP: ANY special character has to be done this way to get a valid xml file.
omggoshh.. That suxx Whats the best alternative then, if I need my html table charts of information to be displayed on other sites, just like an RSS? Thanks
HMM good question .... really without jumping through hoops the only way is rss, which means doing the above nonsense. Only other thing I can think of are images or PFD files and that's not a pretty thing either.
Not sure if this will be helpful or just add to the frustration, but.. ASP.NET has a some server side methods called 'HTMLEncode' and 'URLEncode' which will automatically convert all those characters for you. You can pass the whole string and it will convert all that are necessary. I havn't seen something like this in PHP or Perl, but I'm sure you are not the first to run into it. Chances are someone may have built a similar function if it hasn't been added to PHP already.
Please note that RSS specifications, including RSS 2.0, doesn't allow embed HTML. I suggest you to use Atom 1.0 format that allows to include (X)HTML contents even whithout escaping it.
I dont understand Xhtml and what it means. I know that RSS 2.0 you can add html, but it's not recommended as a) harder to get indexedf or the meta b) other parsers might have trouble recognizing it But it is allowed
You need to encode it. If you use Atom you can add well formed XHTMl or HTML content inline without encoding it.
Oh my god. I remember wasted a whole day figuring that out. It's a very simple solution, Tom_e_rock. All you need is CDATA within your tags. Google for it and you'll know what I mean.
CDATA is just the most simple way to hide parser junk rss content, it's not the right way to create a well formed feed.
There's no need to use those functions, php already has a built-in function for the job In fact those 3 lines can be reduced to this: $description=htmlentities($description); PHP: Hope that helped
I have teen sexuality and it has a integrated feed: http://teen-sexuality.net/component/option,com_rss/Itemid,0/feed,RSS1.0/no_html,1/ but i use joomla cms, not sure how to setup a rss feed manually.
Dalton has a pretty good idea. What you can do to speed up the process is to copy and paste the document into a text file and "find and replace" all the brackets with their proper codes. Makes an hour job turn into a thirty second job.
Here is manual how to setup RSS manually on Joomla. pathos-seo.com/joomla-optimization/setting-up-joomla-rss-feed.html
pretty damn useful - trying to set up a collectables rss and getting nowhere - built my own parser but now I realise other people need to be able to use it..
Quite useful informations about RSS feed.. I agree! But the difference b/w post #12 and #13 is exceptionally cool : 1 year 6 months almost. Take it easy! Thanks