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.

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 11:03:18
Script start
Timing: Jan 18 2025 11:03:18
Module start 'layout'
Timing: Jan 18 2025 11:03:18
Module start 'content'
Timing: Jan 18 2025 11:03:19
Module end 'content'
Timing: Jan 18 2025 11:03:19
Script end

Main resources:

Total runtime0.9293 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.0547152.6250
Module start 'layout' 0.00720.0037 741.679739.4453
Module start 'content' 0.01090.9169 781.1250592.3906
Module end 'content' 0.92770.0015 1,373.515612.1563
Script end 0.9293  1,385.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4142160.0002
Check MTime0.00160.1771160.0001
Mysql Total
Database connection0.00170.186010.0017
Mysqli_queries0.864392.9977650.0133
Looping result0.00080.0816630.0000
Template Total0.888495.620.4442
Template load0.00230.250420.0012
Template processing0.886195.346320.4430
Template load and register function0.00010.015710.0001
states
state_id_array0.00200.214310.0020
state_identifier_array0.00140.152920.0007
Override
Cache load0.00180.1906290.0001
Sytem overhead
Fetch class attribute can translate value0.00120.127930.0004
Fetch class attribute name0.00270.289760.0004
XML
Image XML parsing0.00080.088030.0003
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00220.2359170.0001
String conversion0.00000.000940.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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs