Forums / Developer / creating a new variable

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.

eZ debug

Timing: Jan 18 2025 16:14:59
Script start
Timing: Jan 18 2025 16:14:59
Module start 'content'
Timing: Jan 18 2025 16:15:00
Module end 'content'
Timing: Jan 18 2025 16:15:00
Script end

Main resources:

Total runtime0.8129 sec
Peak memory usage4,096.0000 KB
Database Queries227

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.8359180.8438
Module start 'content' 0.00680.6916 769.6797755.5234
Module end 'content' 0.69840.1144 1,525.2031349.3203
Script end 0.8128  1,874.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4814210.0002
Check MTime0.00150.1896210.0001
Mysql Total
Database connection0.00070.081310.0007
Mysqli_queries0.726589.37112270.0032
Looping result0.00190.23562250.0000
Template Total0.789897.220.3949
Template load0.00240.295620.0012
Template processing0.787396.857020.3937
Template load and register function0.00020.020210.0002
states
state_id_array0.00060.078110.0006
state_identifier_array0.00070.082820.0003
Override
Cache load0.00210.2599610.0000
Sytem overhead
Fetch class attribute can translate value0.00260.315860.0004
Fetch class attribute name0.00170.2065140.0001
XML
Image XML parsing0.00200.245860.0003
class_abstraction
Instantiating content class attribute0.00000.0031140.0000
General
dbfile0.00410.5074360.0001
String conversion0.00000.000830.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
12content/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
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs