Forums / Developer / creating a new variable
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
Saturday 13 August 2005 3:14:43 am
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}
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
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
Wednesday 17 August 2005 3:23:30 am
ok thank's. But I have ever try with it and there is the same result.
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
Friday 19 August 2005 7:08:38 am
there is a function which do the contrary of the function wash?
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
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.