zhuanzhou
zhuanzhou

Reputation: 2443

why this doesn't work and how to correct it?

in a tpl file, there are code as this:

{$LANG.globalyouarehere}: {$breadcrumbnav}

now, i want to do if the url is https://example.com/1.php.it will add a welcome text before the {$breadcrumbnav}. if others, it will not add it.

the following is my ways, but it doesn't work and how to correct it?

{if $_SERVER['REQUEST_URI']==‘1.php’}welcome {$breadcrumbnav}  {else}{$breadcrumbnav} {/if}

Upvotes: 1

Views: 75

Answers (2)

zhuanzhou
zhuanzhou

Reputation: 2443

i got it. put this {$smarty.server.REQUEST_URI}

Upvotes: 3

kskaradzinski
kskaradzinski

Reputation: 5084

try this

{if $_SERVER['REQUEST_URI']==‘/1.php’}welcome {$breadcrumbnav} {else}{$breadcrumbnav} {/if}

Upvotes: 1

Related Questions