XML / RSS: problem with entities - accents ?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am

XML / RSS: problem with entities - accents ?

Post by fredt »

Being a french guy... I'm trying to rss-publish some news containing letters with accents, but I get this in my Tristana reader:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Reference to undefined entity 'eacute'. Error processing resource

Under firefox, when clicking on the orange "XML" button, I get something similar: XML Parsing Error: undefined entity

La loi s'applique aux traitements de données à caractère personnel

I found some other posts, but can't figure how to apply them...

TIA,
FredT
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: XML / RSS: problem with entities - accents ?

Post by Ted »

The problem with the rss template in 0.11.2 is that it didn't wrap some elements in cdata wrappers.  If you want to quickly solve this problem, open up modules/News/templates/rssfeed.tpl.

In there, you should change the description to be:

Code: Select all

<description><![CDATA[{eval var=$entry->strippedsummary}
                        {eval var=$entry->strippedcontent}]]></description>
That way it'll handle any text that's given to it without fear of it breaking the rss namespaces.  You can do the same for title and category as well.

Hope that helps!
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am

Re: XML / RSS: problem with entities - accents ?

Post by fredt »

Thanks a lot, I succeeded - once I figured you were telling me about second ! I suspected some cdata to be involved, but didn't know where it was...

Still something strange : I'm using this on a test page:
{cms_module module='news' number='5' category='articles' makerssbutton="true"}
to display the button, but I get articles for all news categories... while I have this on another page:
{cms_module module='news' dateformat='%d/%m/%Y' number='20' category='articles' moretext="read article..."}, and it only selects "articles".

Is this "by design"  ::) ?

Thanks a lot for the CDATA thing, anyway... The forum promoted me to Enthusiat: YEEESSSS, I AM!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: XML / RSS: problem with entities - accents ?

Post by Ted »

It was more of a design limitation.  However, I fixed it this weekend...  it will use the categories from the first instace of the news module on a page now.
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am

Re: XML / RSS: problem with entities - accents ?

Post by fredt »

OK - is it safe for a previously n00b to start playing with fresh code from the Forge? So I could download & start using the current News module ?
Locked

Return to “CMSMS Core”