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.

eZ debug

Timing: Jan 18 2025 20:56:23
Script start
Timing: Jan 18 2025 20:56:23
Module start 'layout'
Timing: Jan 18 2025 20:56:23
Module start 'content'
Timing: Jan 18 2025 20:56:24
Module end 'content'
Timing: Jan 18 2025 20:56:24
Script end

Main resources:

Total runtime0.8798 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.3047152.6563
Module start 'layout' 0.00550.0037 741.960939.5078
Module start 'content' 0.00920.8693 781.4688602.9297
Module end 'content' 0.87850.0013 1,384.398412.0938
Script end 0.8798  1,396.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3701160.0002
Check MTime0.00140.1645160.0001
Mysql Total
Database connection0.00060.065210.0006
Mysqli_queries0.821293.3351620.0132
Looping result0.00070.0763600.0000
Template Total0.845796.120.4229
Template load0.00210.239620.0011
Template processing0.843695.878720.4218
Template load and register function0.00030.038510.0003
states
state_id_array0.00080.089310.0008
state_identifier_array0.00090.107220.0005
Override
Cache load0.00180.2032430.0000
Sytem overhead
Fetch class attribute can translate value0.00050.054730.0002
Fetch class attribute name0.00160.179860.0003
XML
Image XML parsing0.00120.134030.0004
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00130.1422220.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 32
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs