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