Share » Forums » General » Variable exists

Variable exists

Variable exists

Thursday 25 May 2006 2:12:34 am - 3 replies

Author Message

Marcin Drozd

Friday 26 May 2006 3:25:13 am

Hi Carlos

You can use a template operator is_set( target )
where target = ezhttp('var','get');
and var is name of your get variable from url

see more:
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/template_operators/variable_and_type_handling/get_type
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/template_operators/variable_and_type_handling/is_set
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/template_operators/variable_and_type_handling/is_unset

http://ez-publish.pl

kracker (the)

The Doctor

Wednesday 31 January 2007 7:40:34 am

I tried Marcin's approach for testing if a variable exists with this code,

{if is_set( ezhttp( 'print', 'get' ) )}x{else}z{/if}

I also read a similar thread,
<i>http://ez.no/community/forum/general/how_to_test_for_existance_of_variable</i>

Yet this approach seems to throw a this error,

Error: eZTemplate:ezhttp    Jan 31 2007 10:31:16    Unknown get variable 'print'

Is it possible to test for a variable in template language in this way without throwing an error?

//kracker

<i>sage francis - sick of waiting tables - i apologize</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Kristian Hole

Wednesday 31 January 2007 7:46:19 am

Implemented in 3.9:
http://pubsvn.ez.no/viewcvs/ezp/trunk/doc/features/3.9/added_away_to_check_existence_of_var_in_ezini_or_ezhttp.txt?view=markup

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu