how to let the description about a file only display 3 lines

Author Message

poon sg

Thursday 13 May 2004 8:04:03 pm

I let the description about a file to display in the userinterface, if the description is very long, more than 20 lines, but I just want to display 3 lines and create a link just like Read More, how and i do?

I need help.

thanks!
sgpoon

Mark Marsiglio

Monday 17 May 2004 7:32:19 pm

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

Use the shorten operator to put a maximum number of character to display. You will have to code the link for the Read More... manually after the display of the description.

http://www.ez.no/ez_publish/documentation/development/libraries/ez_template/operators/string_handling

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

poon sg

Wednesday 19 May 2004 2:46:18 am

Hi Mark:
Thanks a million!
I'm a new of EZ, so I still can't solve the problem. I want to let the Intranet file display like the below:

A linked file Submitted by On Date
3 lines of description
read more

my file_line.tpl is:

<div class="file_line">
<table >
<tr>
<td width=60%><h1>{attribute_view_gui attribute=$node.object.data_map.file}</h1></td>
<td width=20% class="time">Submitted by {attribute_view_gui attribute=$node.object.data_map.created_by}</td>
<td width=20% class="time">On {$node.object.published|add(21600)|l10n( datetime )}</td>
</tr>
<tr>
<td colspan=3 width=100% class="intro">{$:item.data_map.description.content.output.output_text|shorten(120)}</td>
</tr>

</table>
</div>

no matter what I changed in line 13, either display the whole distripution or display nothing.

would you please give me more advice?

Best Regards!
sgpoon

poon sg

Wednesday 19 May 2004 8:47:26 pm

Hi Mark!

I've solved the problem, just change the line 13 as below:
($node.object.data_map.description.content.output.output_text|shorten(120)}

but i meet another problem:
can't create a link just link a description of a file.

could you give me some help?

Regards!
sgpoon

Mark Marsiglio

Thursday 20 May 2004 7:24:40 am

>no matter what I changed in line 13, either display the whole distripution or display nothing.

I think that there might be some syntax problems with the data_map calls, but unfortunately, I am not good enough with that to offer any sound advice.

Did you have it working at one point, but with the long version of the description? If so, I would get to that point, and just apply the shorten operator to that.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Mark Marsiglio

Thursday 20 May 2004 10:06:15 am

You would want to link to a new template that you would make that only displays the file description. (create a new template, set the override to display that content with the new template) However, it would probably be better to the a File display template which displays file name, full file description, download link, author, etc.) and make that the page that is linked from the Read More link.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

poon sg

Thursday 20 May 2004 8:48:18 pm

Hi Mark:

You help me a lot.
now I can make it work successful.

Regards!
sgpoon

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

Main resources:

Total runtime0.0128 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.0048 588.1719152.6563
Module start 'layout' 0.00480.0020 740.828139.5078
Module start 'content' 0.00680.0042 780.335997.3984
Module end 'content' 0.01100.0018 877.734438.3047
Script end 0.0128  916.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002317.6234140.0002
Check MTime0.00107.9547140.0001
Mysql Total
Database connection0.00085.855910.0008
Mysqli_queries0.001813.831130.0006
Looping result0.00000.100410.0000
Template Total0.001612.110.0016
Template load0.00086.119910.0008
Template processing0.00085.963710.0008
Override
Cache load0.00064.320310.0006
General
dbfile0.00021.782880.0000
String conversion0.00000.048340.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