List SearchResult with more info

Author Message

K259

Wednesday 03 August 2005 5:10:06 am

In our search we list title, when content is updated and parent title, but we also want to have some more text from the description attribute, i.e. 2 lines from the text which makes it all easier to see what the text is all about..

I use:
{attribute_view_gui attribute=$SearchResult:item.data_map.description}

But get all the text..does anyone know how I can get only 2 lines pr. ResultItem?

Tnx in advance

David Eriksson

Wednesday 03 August 2005 5:41:25 am

You can use template operator shorten to shorten the text to a specified number of characters. It also automatically appends "...".

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/strings/shorten

/David

K259

Wednesday 03 August 2005 5:52:53 am

Hi tnx

I tried:
{attribute_view_gui attribute=$SearchResult:item.data_map.description|shorten( 15 )}
but without success.. maybe it doesn't work with attribute_view_gui?

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 15:55:20
Script start
Timing: Jan 18 2025 15:55:20
Module start 'layout'
Timing: Jan 18 2025 15:55:20
Module start 'content'
Timing: Jan 18 2025 15:55:21
Module end 'content'
Timing: Jan 18 2025 15:55:21
Script end

Main resources:

Total runtime1.3038 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.0547152.6250
Module start 'layout' 0.00770.0037 741.679739.4453
Module start 'content' 0.01141.2906 781.1250495.6328
Module end 'content' 1.30200.0018 1,276.75788.1563
Script end 1.3038  1,284.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2519160.0002
Check MTime0.00130.1007160.0001
Mysql Total
Database connection0.00150.114310.0015
Mysqli_queries1.259296.5751570.0221
Looping result0.00060.0424550.0000
Template Total1.270197.420.6350
Template load0.00210.164520.0011
Template processing1.267997.245520.6339
Template load and register function0.00020.017810.0002
states
state_id_array0.00080.060010.0008
state_identifier_array0.00160.122520.0008
Override
Cache load0.00160.1261160.0001
Sytem overhead
Fetch class attribute can translate value0.00060.049420.0003
Fetch class attribute name0.00220.165130.0007
XML
Image XML parsing0.00030.019720.0001
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00110.0845100.0001
String conversion0.00000.000640.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs