[Plone-Users] Plone RSS syndication fundamentally broken: FIXED

0 views
Skip to first unread message

Barney Carroll

unread,
Feb 20, 2007, 9:20:39 AM2/20/07
to plone...@lists.sourceforge.net
A while back I activated the RSS syndication as built in to Plone on the
news folder of a site, and said feed only ever presented the first items
instead of last, as it should.

Found out this was down to an incomprehensible mistake in the core
rss_template.pt, which only needed a simple bit of revision.

[diff]

12 12 <metal:block
13 13 define-macro="master"
14 14 tal:define="
15 15 syn context/portal_syndication;
16 16 max max_items|python:syn.getMaxItems(here);
17 objects python: objectList[:max]"
17 objects python: objectList[-max:]"
17 17 >

[/diff]


Find it hard to understand how Plone could ship with this feature set to
display first items by default, also bizarre I couldn't find this
addressed on this list or anywhere else on the net.

Am I missing something, or is this a solution to the problem?


Regards,
Barney

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
Plone...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users

Ricardo Newbery

unread,
Feb 20, 2007, 2:32:18 PM2/20/07
to Barney Carroll, plone...@lists.sourceforge.net
At 2:20 PM +0000 2/20/07, Barney Carroll wrote:
>A while back I activated the RSS syndication as built in to Plone on the
>news folder of a site, and said feed only ever presented the first items
>instead of last, as it should.
>
>Found out this was down to an incomprehensible mistake in the core
>rss_template.pt, which only needed a simple bit of revision.
>
>[diff]
>
>12 12 <metal:block
>13 13 define-macro="master"
>14 14 tal:define="
>15 15 syn context/portal_syndication;
>16 16 max max_items|python:syn.getMaxItems(here);
>17 objects python: objectList[:max]"
> 17 objects python: objectList[-max:]"
>17 17 >
>
>[/diff]
>
>
>Find it hard to understand how Plone could ship with this feature set to
>display first items by default, also bizarre I couldn't find this
>addressed on this list or anywhere else on the net.
>
>Am I missing something, or is this a solution to the problem?


I'm not sure but I believe the responsibility for providing the
correct order lies with the container object. The RSS feed is just
supposed to provide the top items returned by either
obj.synContentValues() or obj.getFolderContents(). I'm guessing that
if your news folder is sorted correctly, the stock rss_template
should give you exactly what you want.

Ric

Barney Carroll

unread,
Feb 21, 2007, 4:55:37 AM2/21/07
to plone...@lists.sourceforge.net
Ricardo Newbery wrote:
> I'm not sure but I believe the responsibility for providing the correct
> order lies with the container object. The RSS feed is just supposed to
> provide the top items returned by either obj.synContentValues() or
> obj.getFolderContents(). I'm guessing that if your news folder is
> sorted correctly, the stock rss_template should give you exactly what
> you want.
>
> Ric

This probably explains why no-one seems to have cried for help on this
before, and it was my original thought.

But if you modify the feed compilation at the highest order, then you
can attach feeds to any part of your site, without having to
specifically configure folders to list their contents in reverse order...

This method makes a lot more sense to me (why would you want to have
your RSS set to load the /oldest/ first by default?), but I guess there
may be other values to configuring your news folder properly.


Regards,
Barney

Ricardo Newbery

unread,
Feb 21, 2007, 7:33:56 AM2/21/07
to plone...@lists.sourceforge.net
At 9:55 AM +0000 2/21/07, Barney Carroll wrote:
>Ricardo Newbery wrote:
>> I'm not sure but I believe the responsibility for providing the correct
>> order lies with the container object. The RSS feed is just supposed to
>> provide the top items returned by either obj.synContentValues() or
>> obj.getFolderContents(). I'm guessing that if your news folder is
>> sorted correctly, the stock rss_template should give you exactly what
>> you want.
>>
>> Ric
>
>This probably explains why no-one seems to have cried for help on this
>before, and it was my original thought.
>
>But if you modify the feed compilation at the highest order, then you
>can attach feeds to any part of your site, without having to
>specifically configure folders to list their contents in reverse order...
>
>This method makes a lot more sense to me (why would you want to have
>your RSS set to load the /oldest/ first by default?), but I guess there
>may be other values to configuring your news folder properly.


I don't believe I said oldest first. Just in whatever order is
defined for the object. In my experience, newest first is fairly
standard for RSS feeds -- both for the HTML display and the RSS feed.
RSS feeds were pretty much adopted first by the blogging community
where this is the typical order.

In any case, I don't think we want to hard code the order into the
template. There needs to be some way to configure it for different
use-cases. That means putting the sort control onto the container
object not the generic RSS template.

It might be an interesting enhancement to the stock Plone Folder
object to have a switch to sort the display in reverse chronological
order (of the creation date?). But you can get this now with a Smart
Folder. In your example, the news folder is just a Smart Folder
displaying news entries in reverse chronological order -- the RSS
feed for this folder should spit out the same order.

I believe most RSS feeds usually just mirror the content order of the
source page. But the syndication tool checks first for a
synContentValues method before the regular getFolderContents method.
So if you want a special object which you would like to display in
one order (via getFolderContents) but create an RSS feed in a
different order (via synContentValues), you have that flexibility --
although to get this effect, you might need to subclass your own
folderish or topic content type.

Ric

Reply all
Reply to author
Forward
0 new messages