how to use extract_left ?

Author Message

kavi kavi

Thursday 18 January 2007 8:47:55 am

Hello !
I want to extract 20 characters from my article.
I didn't find the syntax for using extract_left with {attribute_view_gui attribute=$node.object.data_map.intro}

Someone of you know how to use ????
Thanks
kavi

Luc Chase

Thursday 18 January 2007 8:52:12 am

Did you try?
{attribute_view_gui attribute=$node.object.data_map.intro|extract_left(20)}

The Web Application Service Provider

Nabil Alimi

Thursday 18 January 2007 9:27:19 am

Hi,

This won't work since extract_left should be used on a string.

You need to apply this directly on the output of the content of your datatype.

{$node.data_map.intro.content|extract_left( 20 )}

This means this is incompatible with the attribute_view_gui operator.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

kavi kavi

Friday 19 January 2007 12:41:43 am

Hi Nabil !
thanks for your quick answer.
I've just tried your suggestion. But it doesn't work !!!
My code is in the override/templates/listitem/article.tpl

<li class="extraitNews">
<h1>
<a href={$node.url_alias|ezurl} title="Lien vers : {$node.object.data_map.title.content|wash}">{$node.object.data_map.title.content|wash}</a>
</h1>

<p>{attribute_view_gui attribute=$node.object.data_map.intro} </p>
</li>

If extract_left is incompatible with attribute_view_gui, do you think that i've to modify another template..?!
kavi

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

Main resources:

Total runtime0.0180 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.0079 589.0391152.6250
Module start 'layout' 0.00790.0032 741.664139.4453
Module start 'content' 0.01110.0045 781.109489.4453
Module end 'content' 0.01560.0024 870.554734.3047
Script end 0.0180  904.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002815.5665140.0002
Check MTime0.00116.3454140.0001
Mysql Total
Database connection0.00168.748910.0016
Mysqli_queries0.003620.151330.0012
Looping result0.00000.060810.0000
Template Total0.002011.110.0020
Template load0.00094.766010.0009
Template processing0.00116.258110.0011
Override
Cache load0.00063.180010.0006
General
dbfile0.00031.505380.0000
String conversion0.00000.043740.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