Forums / Developer / shorten operator don't display text

shorten operator don't display text

Author Message

K259

Wednesday 03 August 2005 6:00:11 am

I try to shorten the text displayed with:
{attribute_view_gui attribute=$SearchResult:item.data_map.description|shorten( 15 )}

But I don't think that |shorten works with atribute_view_gui..I don't get any output with just
{$SearchResult:item.data_map.description} so I have to use the attribute_view_gui.

Does anyone know how to solve this?

Guillaume Kempfer

Thursday 04 August 2005 1:10:45 am

Hi,

You cannot do that.
If you want to do that you should create an override of "design/standard/content/searchresult.tpl"

K259

Thursday 04 August 2005 1:43:53 am

Hmm..but do you know how I can output text in a template with the use of this shorten-operator?

I tried:
{$SearchResult:item.data_map.description|shorten(15)}
but it don't output anything..

This works:
{attribute_view_gui attribute=$SearchResult:item.data_map.description}
but then I get all the text from the description field, which makes the searchresultpage a mess..

Paul Borgermans

Thursday 04 August 2005 3:02:24 am

It is possible, look for example this thread:

http://ez.no/community/forum/setup_design/shorten_operator_with_viewing_attributes

You will need to define the striptags template operator (also explained there) if it is about shortening xml attributes. Simple text is simpler.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

K259

Thursday 04 August 2005 3:16:35 am

Tnx. Just what I needed, but couldn't find it in the ez search.

eZ debug

Timing: Jan 18 2025 05:03:32
Script start
Timing: Jan 18 2025 05:03:32
Module start 'content'
Timing: Jan 18 2025 05:03:34
Module end 'content'
Timing: Jan 18 2025 05:03:34
Script end

Main resources:

Total runtime2.0335 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0102 587.7344180.8281
Module start 'content' 0.01021.8354 768.5625593.4688
Module end 'content' 1.84560.1878 1,362.0313337.3984
Script end 2.0335  1,699.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.2132210.0002
Check MTime0.00170.0854210.0001
Mysql Total
Database connection0.00160.078310.0016
Mysqli_queries1.953496.06142020.0097
Looping result0.00230.11542000.0000
Template Total1.976397.220.9882
Template load0.00210.102720.0010
Template processing1.974297.084120.9871
Template load and register function0.00010.006510.0001
states
state_id_array0.00380.186310.0038
state_identifier_array0.00290.140620.0014
Override
Cache load0.00180.0875290.0001
Sytem overhead
Fetch class attribute can translate value0.00180.088440.0004
Fetch class attribute name0.00170.083360.0003
XML
Image XML parsing0.00100.050540.0003
class_abstraction
Instantiating content class attribute0.00000.000660.0000
General
dbfile0.00410.2023280.0001
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0003 secs