How function smarty on Gallery2
How function the if with an equality ==?
------------------
this is ok
{if A==A}
.....
{/if}
-------------------
but if I write so (is only a test where 1st and 2nd are identical):
{if ( {g->url params=$link.params} ) == ( {g->url params=$link.params} ) }
....
{/if}
smarty not work (got error)
I want to confront this code:
{g->url params=$link.params}
with this
{g->url arg1="view=slideshowapplet.SlideshowApplet" arg2="itemId=`$theme.item.id`"}
How I can write the code?
Posts: 8601
you cannot use {anything} when already inside {if}
how about {if $link.params == $link.params} ?
if the parameters are the same they should produce the same g->url..
Posts: 808
Maybe I'm confused (which at times isn't hard) but I don't understand what you are trying to do? Why would you want to write an if statement that will always be true?
Posts: 40
This is only a test in order to control why Smarty got error when I
use the if.
Smarty so is ok work
{if A==A}
.....
{/if}
-------------------
but if I use this for test not work
{if ( {g->url params=$link.params} ) == ( {g->url params=$link.params} ) }
....
{/if}
although the 2 values are equal
The real comparison that I must make is within a cycle and must verify the point where the link (or parameters) of this:
{g->url params=$link.params}
is equal at link (or parameter) of this:
{g->url arg1="view=slideshowapplet.SlideshowApplet" arg2="itemId=`$theme.item.id`"}
The code that I have write is this
{if
({g->url params=$link.params})
==
{g->url arg1="view=slideshowapplet.SlideshowApplet" arg2="itemId=`$theme.item.id`"}
......
{/if}
but I have error so I have tested that code above;
and I have understand that this isn't the corrected form to write the code.
I think that I must compare not all the link but only the parameters
, but how?
some similar this:
($link.params) == (arg1="view=slideshowapplet.SlideshowApplet" arg2="itemId=`$theme.item.id`")
or this
($link.params) == ("view=slideshowapplet.SlideshowApplet" "itemId=`$theme.item.id`")
or this
($link.params) == (slideshowapplet.SlideshowApplet `$theme.item.id`)
any idea???
thanks