Forums / Developer / Submit error / Comment51656

Author Topic

André R.

Friday 28 August 2009 5:45:38 am

Comment51656

Your mixing template code and php code.
Simply put, you can only use php code in *.php files, and only template code in *.tpl files.

Your code needs to be rewritten to template code as this looks to be inside a template.

It would be something like:

{def $post_search_text = ''}
{if ezhttp_hasvariable( 'Estado', 'post' )}
    {set $post_search_text = ezhttp( 'Estado', 'post' )}
{/if}
{if ezhttp_hasvariable( 'Cidade', 'post' )}
    {set $post_search_text = concat($post_search_text, ' ', ezhttp( 'Cidade', 'post' ))}
{/if}
<input type="hidden" name="SearchText" value="{$post_search_text}" />

See:
http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/data_and_information_extraction/ezhttp_hasvariable
http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/data_and_information_extraction/ezhttp
And for concat( press ctrl+f to find it ):
http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom