Display first 100 chars

Author Message

David Jones

Wednesday 04 October 2006 4:34:25 am

I have an object with lots of text. I wont to display the first 100 chars of it rather than the whole thing.

I know I've seen this somewhere but I can't seem to find it now.

Could somebody point me in the right direction please.

Thanks

J-A Eberhard

Wednesday 04 October 2006 5:15:08 am

Use the template operator shorten

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

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Xavier Dutoit

Wednesday 04 October 2006 8:35:27 am

This being said, beware if your attribute is an xml text, as you might cut it between the start end the end of the tag (eg: <b> Char n°100 </b> Would cut the text before the </b> and might seriously screw up your layout.

X+

http://www.sydesy.com

David Jones

Thursday 05 October 2006 12:51:13 am

Thats the one, I knew I'd seen it just couldn't remember what to serach for. I tried all sorts of things.

Anyway, Thanks guys.

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

Main resources:

Total runtime0.0221 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.0075 589.1484152.6250
Module start 'layout' 0.00750.0036 741.773439.4453
Module start 'content' 0.01120.0089 781.218889.2109
Module end 'content' 0.02000.0021 870.429734.3047
Script end 0.0221  904.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002712.3958140.0002
Check MTime0.00114.8659140.0001
Mysql Total
Database connection0.00146.209810.0014
Mysqli_queries0.003616.325030.0012
Looping result0.00000.103410.0000
Template Total0.00177.710.0017
Template load0.00083.731010.0008
Template processing0.00093.965810.0009
Override
Cache load0.00062.592910.0006
General
dbfile0.004319.616780.0005
String conversion0.00000.040940.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