N
N
naneri2014-07-24 08:13:26
PHP
naneri, 2014-07-24 08:13:26

How to concatenate variables in if-else in Smarty?

There was a problem.
In a Smarty template, you need to find out if the current page matches the blog page - and in case of a match, do not display a specific block.
Nowhere can I find information on variable concatenation in if-else.

{if {$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI} != $oTopic->getUrl() }

This is the code that throws an error. (It seems to me correct, but how then to concatenate strings - I absolutely do not understand).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RJs45, 2014-07-24
@naneri

Something like this:

{assign var='tmpVar' value=$smarty.server.HTTP_HOST|cat:$smarty.server.REQUEST_URI}
{if $tmpVar != $oTopic->getUrl()}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question