| Re: problem with smarty and logical operators |
| by christian on 2005/5/22 23:25:11 Thousand thanks Dave, it's ok now
|
| Re: problem with smarty and logical operators |
| by Dave_L on 2005/5/22 23:07:54 Quote: <{if substr($article.headline,1,4) != "Menu"}> This works for me. Note that substr(...,1,4) returns four characters starting at the second character of the string. For example, substr("abcdef",1,4) is "bcde". Quote: <{if $article.headline != "Saveurs régionales" or $article.headline != "Menu de saison"}> This also works. But it doesn't make much sense, since the if-clause will always be true. I.e., if A != B, as they are in your case, then the expression (C != A or C != B) is a tautology (always true). |
| Re: problem with smarty and logical operators |
| by christian on 2005/5/22 20:23:34 I have the same problem with wfchannel_index.html. This is ok <{if $article.headline != "Saveurs régionales"}> <{$article.headline}> <{/if}> But this lines are not implemented <{if substr($article.headline,1,4) != "Menu"}> <{if $article.headline != "Saveurs régionales" or $article.headline != "Menu de saison"}> Have you a idea ? |
| Re: problem with smarty and logical operators |
| by Maxter on 2004/10/12 16:53:34 thanks for the answers... ![]() Mithrandir: yes, the Slink.logourl is a typo in the post, i checked many times the syntax :) before posting i also tried to separate the condition with bracket, without any result :-/ Draven: i tried also the use of OR instead of ||, again without any result, and i have read the smarty documentation many times searching for any possible idea. I will try to reproduce this error in another page containing only the $link array or another array, to see it the error happen again. |
| Re:problem with smarty and logical operators |
| by Draven on 2004/10/12 15:44:57 Also be sure to check the smarty doc site for proper use of the || operator, my suggestion would be to use OR instead. http://smarty.php.net/manual/en/language.function.if.php Quote:
|