Forums / Developer / content/tipafriend doesn't equal content/tipafriend
Will Diaz
Wednesday 15 March 2006 2:52:23 pm
I'm on page www.domain.com/content/tipafriend. The value of $requested_uri_string should be "content/tipafriend"
However, the following if statement fails every time:
{let $current_requested_uri=$requested_uri_string|trim("/")} {if ($current_requested_uri|eq('content/tipafriend'))} TIP A FRIEND {else} PLEASE DO NOT TIP FRIENDS {$current_requested_uri} {/if} {let}
When I echo the value of $current_requested_uri I get "content/tipafriend" so the if statement should evaluate as true.
Why isn't this working?
Ćukasz Serwatka
Wednesday 15 March 2006 11:00:22 pm
Hi Will,
Remove brackets from if statement. Your code will cause parse error.
{if ($current_requested_uri|eq('content/tipafriend'))}
Try with code below and then should work.
{if $current_requested_uri|eq('content/tipafriend')}
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Kristof Coomans
Wednesday 15 March 2006 11:03:22 pm
You should enable debug output while changing templates, so you'll be warned about any template errors.
See http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/debugsettings and http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/templatesettings
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
Thursday 16 March 2006 8:41:28 am
Thank you both. That fixed my issue!