Forums / Setup & design / Automatic summary of full content (for purpose of RSS feed)

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

eZ debug

Timing: Jan 31 2025 04:23:27
Script start
Timing: Jan 31 2025 04:23:27
Module start 'content'
Timing: Jan 31 2025 04:23:27
Module end 'content'
Timing: Jan 31 2025 04:23:28
Script end

Main resources:

Total runtime0.1291 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1875180.7969
Module start 'content' 0.00540.0051 768.984497.9766
Module end 'content' 0.01060.1183 866.9609528.4219
Script end 0.1289  1,395.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00322.4771200.0002
Check MTime0.00131.0200200.0001
Mysql Total
Database connection0.00060.456810.0006
Mysqli_queries0.084165.14051410.0006
Looping result0.00110.87461390.0000
Template Total0.118091.410.1180
Template load0.00080.634210.0008
Template processing0.117290.758610.1172
Override
Cache load0.00060.441310.0006
Sytem overhead
Fetch class attribute can translate value0.00110.888310.0011
XML
Image XML parsing0.00040.289710.0004
General
dbfile0.00826.3354200.0004
String conversion0.00000.004230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs