Automatic summary of full content (for purpose of RSS feed)

Author Message

Neven Susa

Thursday 14 June 2007 3:35:48 pm

This could be tricky problem (generally, not only in this situation).
I'm not sure that it is possible with eZ.

Here it is:
There is a weblog class (similar to original that comes with install or package) with <i>message</i> attribute (XML text). For now, there is no <i>summary</i>-like attribute.
When displaying on site, i use operator
e.g. $node.data_map.message.data_text.shorten(500)

Now occured need for RSS feed and it is not apropriate to use whole content of message for RSS description-tag.
Built-in RSS module, likewise Syndicate RSS extension (by Pascal von Büren) don't support functionality to use attribute <i>modified</i> for description-tag.
Or, to dynamically create new attribute based on existing attribute of the class.

For a moment I thought it is supported:
(<quote> from description of Syndication RSS "*In the description of an RSS-Item, you can now combine multiple attributes from a content class"),
but this is not what i want.

Well, I could create new attribute 'summary' for future use, but here is two issues about that:
1) In general, it is more consistent to have fixed length of summary. When entered manually, these have tendency to have rather different length, depending on editor's will.
2) (this is only time consuming) If i create new attribute for existing class, already published articles need to be re-published with entered summary element/attribute.

So, any ideas?

Xavier Dutoit

Thursday 14 June 2007 11:46:58 pm

Hi,

Not sure it answers your question, but don't use the shorten operator on a xml text, you are sooner or later going to cut it between the opening one and the closing one and that's going to mess your layout.

Use this operator instead:
http://projects.ez.no/xmlwash

http://www.sydesy.com

Neven Susa

Friday 15 June 2007 2:57:00 am

Thank you Xavier for xmlwash().
I didn't experienced any problems so far with shorten operator, but i'll try your solution.

Anyway, this is not issue here.
I know that RSS readers have option to shorten description e.g. at wanted number of lines or characters, but not all of them and not in default settings.

eZ RSS module doesn't have option to <i>manipulate</i> class attributes for RSS export. Only whole or combined (in extension) attributes can be exported to rss 'description field'.
I don't have appropriate field to export because 'summary' attribute is missing.

First solution is to create it now, and re-publish all blogs with summary entered. This would be dirty solution.

A nicer one is if I could manage to dynamically create this shortened content for export to feed.
Also it is more consistent because of (Xavier Dutoit quote):
"Unfortunately, there isn't a simple way to limit the length of that introduction, and some authors have a rather extensive interpretation of it (bless them, some put the complete article into the introduction)" - interesting observation, last one :)

Someone know how to solve this? Thanks.

Damien Pobel

Friday 15 June 2007 3:09:38 am

Hi Newen,

you can perhaps use the layout system to build your own RSS export with templates, that's more flexible and you can do almost everything with (custom) operators.
I wrote an article (in french) on this topic : http://pwet.fr/blog/des_fils_rss_sur_mesure_dans_ez_publish

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.