String Truncation

Author Message

Mahesh Arvind

Thursday 08 January 2004 10:56:02 pm

Hi,

I need to limit the number of characters displayed about the article introduction to 120 characters. I had tried this with the shorten method. I have used the following code

{$:item.data_map.resource_introduction.data_text|shorten(120)}

The output is that I dont see any characters if I use shorten. I am using Ez Publish 3.2.4. Can anyone tell me how to accomplish this.

Thanks
Mahesh

Thanks & Regards
Mahesh

Mahesh Arvind

Monday 12 January 2004 2:31:35 am

Hi,

I got it working in the following code

{$:item.data_map.resource_introduction.content.output.output_text|shorten(120)}

Thanks.

Mahesh

Thanks & Regards
Mahesh

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 19 2025 01:02:13
Script start
Timing: Jan 19 2025 01:02:13
Module start 'layout'
Timing: Jan 19 2025 01:02:13
Module start 'content'
Timing: Jan 19 2025 01:02:13
Module end 'content'
Timing: Jan 19 2025 01:02:13
Script end

Main resources:

Total runtime0.0207 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.0391152.6094
Module start 'layout' 0.00690.0032 741.648439.4297
Module start 'content' 0.01010.0079 781.078189.3047
Module end 'content' 0.01800.0026 870.382830.3047
Script end 0.0206  900.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002913.8811140.0002
Check MTime0.00146.6225140.0001
Mysql Total
Database connection0.00125.592310.0012
Mysqli_queries0.002914.164630.0010
Looping result0.00000.077210.0000
Template Total0.00188.910.0018
Template load0.00115.263910.0011
Template processing0.00073.566510.0007
Override
Cache load0.00062.933910.0006
General
dbfile0.00031.652580.0000
String conversion0.00000.054240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0001 secs