content/tipafriend doesn't equal content/tipafriend

Author Message

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

Will Diaz

Thursday 16 March 2006 8:41:28 am

Thank you both. That fixed my issue!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 21:05:43
Script start
Timing: Jan 18 2025 21:05:43
Module start 'layout'
Timing: Jan 18 2025 21:05:43
Module start 'content'
Timing: Jan 18 2025 21:05:43
Module end 'content'
Timing: Jan 18 2025 21:05:43
Script end

Main resources:

Total runtime0.0175 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 589.1953152.6406
Module start 'layout' 0.00780.0039 741.835939.4766
Module start 'content' 0.01170.0039 781.312593.3984
Module end 'content' 0.01560.0019 874.710934.3047
Script end 0.0175  909.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002815.8034140.0002
Check MTime0.00126.9629140.0001
Mysql Total
Database connection0.00116.412910.0011
Mysqli_queries0.003721.347730.0012
Looping result0.00000.108910.0000
Template Total0.00158.710.0015
Template load0.00084.568010.0008
Template processing0.00074.140510.0007
Override
Cache load0.00063.210510.0006
General
dbfile0.00042.163580.0000
String conversion0.00000.062640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs