creating a new variable

Author Message

jb bianchi

Wednesday 10 August 2005 6:59:27 am

hi,

It 's possible to creat a new variable with this {attribute_view_gui attribute=$node.object.data_map.name}?

because I have a test to do with an another variable

and when i do this :

{if eq({attribute_view_gui attribute=$node.object.data_map.name}
, $variable} 
1
{else}
2{/if} 

the result is only 2.

And I have put before the {if}....{/if} this code :


{attribute_view_gui attribute=$node.object.data_map.name}=
{$variable}=
</coed>
and I can see the same word so I understand that I couldn't do the test like I do.


thank's

jb bianchi

Saturday 13 August 2005 3:14:43 am

hi,

I try to do this

$variable2=node.object.data_map.name

but no result.

Any ideas?

thank's.

K259

Tuesday 16 August 2005 6:14:46 am

$variable2={node.object.data_map.name}

jb bianchi

Tuesday 16 August 2005 6:53:35 am

I have already try it and no result.

Paul Borgermans

Tuesday 16 August 2005 8:22:17 am

Hi

Try

{if eq($node.object.data_map.name.content
, $variable)} 
1
{else}
2{/if}

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

jb bianchi

Wednesday 17 August 2005 1:21:54 am

thank's but with it there is no result.
Nobody know how can I creat a new variable with {attribute_view_gui attribute=$node.object.data_map.name}?

I thank you for your answer.

ps: The problem with the last answer it that there is a \n at the end of $node..... and each time I see the value 2..

Ole Morten Halvorsen

Wednesday 17 August 2005 2:10:27 am

Hi,

Use the trim operator to remove \n.
See http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/strings/trim

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

jb bianchi

Wednesday 17 August 2005 3:23:30 am

ok thank's. But I have ever try with it and there is the same result.

jb bianchi

Thursday 18 August 2005 7:43:25 am

Since yesterday I try to remove an <br /> to an varialbe.
I try the trim operator but no result.
DO you know what I have to do?
Thank's

jb bianchi

Friday 19 August 2005 7:08:38 am

hi,

there is a function which do the contrary of the function wash?

thank's.

Marko Žmak

Sunday 21 August 2005 5:45:31 am

Hi bianchi. For this new variable thing, why don't you try {set-block}? It goes something like this:

{set-block var=your_variable}
{attribute_view_gui attribute=$node.object.data_map.name}
{/set-block}

After that you can use $your_variable in the {if} statement. I'm not sure of the correct syntax, check the docs for that.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

jb bianchi

Tuesday 23 August 2005 3:00:47 am

Hi,
thank's there isn't problem any more.
I have usee the set block and after I use function of Ez pUblish to do what I want.

Thank's a lot.

JB.

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

Main resources:

Total runtime0.0135 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.0045 587.9063152.6250
Module start 'layout' 0.00450.0026 740.531339.4453
Module start 'content' 0.00700.0046 779.9766101.4297
Module end 'content' 0.01160.0018 881.406342.3047
Script end 0.0134  923.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002417.7471140.0002
Check MTime0.00118.4923140.0001
Mysql Total
Database connection0.00075.113110.0007
Mysqli_queries0.002115.829230.0007
Looping result0.00000.074310.0000
Template Total0.001511.110.0015
Template load0.00085.647410.0008
Template processing0.00075.394410.0007
Override
Cache load0.00064.170110.0006
General
dbfile0.00042.830880.0000
String conversion0.00000.051340.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