I have simple template like this
[[!If?
&subject=`[[!ifIssetsGetInUrl? &name=`t`]]`
&operator=`EQ`
&operand=`0`
&then=`[[*content]]`
&else=`[[!getApiPageAlias? &t=`[[!getUrlParam? &name=`t` &int=`0`]]` &u=`[[!getUrlParam? &name=`u` &int=`0`]]` &e=`[[!getUrlParam? &name=`e` &int=`0`]]` &defaultcontent=`[[*content]]`]]`
]]
It always goes in else??
But if I do something like this
[[!If?
&subject=`[[!ifIssetsGetInUrl? &name=`t`]]`
&operator=`EQ`
&operand=`0`
&then=`[[*content]]`
&else=`YES`
]]
It is working fine, where can be the problem?
<a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
My guess is that the nested, uncached tags in the &else have not been parsed by the time when the outer else tag is parsed. Your code is not that simple. You have a snippet tag inside a snippet tag inside a snippet tag inside a chunk. Once you get to that level of nesting, things tend to break down.
It's seems a remarkably complex way of doing what you want, since you're calling four separate snippets. You might consider one snippet something like this:
$content = $modx->resource->get('content'));
$output = '';
if (isset($_GET['t'])) {
$output = $content;
} else {
/* modified getApiPageAlias code here to set $output */
}
$output = empty($output)? $content : $output;
return $output;