Forums / Setup & design / how to let the description about a file only display 3 lines

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

eZ debug

Timing: Jan 18 2025 15:50:55
Script start
Timing: Jan 18 2025 15:50:55
Module start 'content'
Timing: Jan 18 2025 15:50:56
Module end 'content'
Timing: Jan 18 2025 15:50:56
Script end

Main resources:

Total runtime1.1145 sec
Peak memory usage4,096.0000 KB
Database Queries206

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9688180.7969
Module start 'content' 0.00610.9947 768.7656597.2656
Module end 'content' 1.00080.1137 1,366.0313341.0547
Script end 1.1144  1,707.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3698210.0002
Check MTime0.00150.1383210.0001
Mysql Total
Database connection0.00090.084410.0009
Mysqli_queries1.038193.13872060.0050
Looping result0.00180.15752040.0000
Template Total1.086597.520.5433
Template load0.00200.177120.0010
Template processing1.084597.310120.5423
Template load and register function0.00020.014510.0002
states
state_id_array0.00110.101710.0011
state_identifier_array0.00070.064420.0004
Override
Cache load0.00180.1576600.0000
Sytem overhead
Fetch class attribute can translate value0.00250.228130.0008
Fetch class attribute name0.00150.136880.0002
XML
Image XML parsing0.00080.070830.0003
class_abstraction
Instantiating content class attribute0.00000.0016100.0000
General
dbfile0.00230.2028260.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs